linux – 在Debian中禁用服务的推荐方法

前端之家收集整理的这篇文章主要介绍了linux – 在Debian中禁用服务的推荐方法前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
在Debian中禁用服务是否有“推荐方法”? (禁用=服务已安装但在计算机启动时不会自动启动.)

我知道你可以更新-rc.d -f服务删除(它基本上删除了rcX.d中的链接),但这样做会丢失服务的序列号(SXXservice,XX是序列号),使生活变得生动当您想要重新启用服务时更难.我也知道我可以重命名rcX.d中的链接,这样它们就不会以S开头(或者将它们移动到其他地方),但我想知道是否有一些“Debian批准的最佳实践”方法来做到这一点.

解决方法

查看update-rc.d手册页.名为Installing Init Script Links的部分的第三段读取…

A common system administration error is to delete the links with the thought that this will “disable” the service,i.e.,that this will prevent the service from being started. However,if all links have been deleted then the next time the package is upgraded,the package’s postinst script will run update-rc.d again and this will reinstall links at their factory default locations. The correct way to disable services is to configure the service as stopped in all runlevels in which it is started by default. In the System V init system this means renaming the service’s symbolic links from S to K.

最后两句话应该回答你的问题. 原文链接:https://www.f2er.com/linux/402116.html

猜你在找的Linux相关文章