加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

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

发布时间:2020-12-13 18:27:56 所属栏目:Linux 来源:网络整理
导读:在Debian中禁用服务是否有“推荐方法”? (禁用=服务已安装但在计算机启动时不会自动启动.) 我知道你可以更新-rc.d -f服务删除(它基本上删除了rcX.d中的链接),但这样做会丢失服务的序列号(SXXservice,XX是序列号),使生活变得生动当您想要重新启用服务时更难.
在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.

最后两句话应该回答你的问题.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读