Debian / Ubuntu 系列 GNU/Linux 服務開機自動啟動調整

有些服務不是apt-get安裝完之後就完了,像是apache2開機的時候會自己帶起來,但vsftp就不會

利用update-rc.dinsserv可以來做調整,加入需要開機自動啟動的程式、反之移除沒需要的

其實就是幫你把init.d底下的script link進rc*.d底下去~ (* = runlevel) 就會跟著系統啟動一起執行這些程式~

Debian 6.0以前用update-rc.d、6.0開始用insserv(舊的看起來還是會動就是了),而Ubuntu則是用update-rc.d

最常用的應該就…

設啟動
insserv servicename

update-rc.d servicename defaults

從預設啟動裡面移除
insserv -r servicename

update-rc.d servicename remove

runlevel什麼的就先不管它了 暫時沒需求 :P

Reference:
LSBInitScripts/DependencyBasedBoot – Debian Wiki
The Debian GNU/Linux FAQ – Customizing your installation of Debian GNU/Linux
Update-rc.d – LQWiki
Ubuntu Manpage: update-rc.d – install and remove System-V style init script links

PS:
Redhat系列的好像是chkconfig servicename on這樣?

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。