debian / ubuntu use update-rc.d command to add / disable boot entry

share it:

debian / ubuntu use update-rc.d command to add / disable boot entry

https://www.moerats.com/archives/577/


Description: common Linuxstartup items is in /etc/rc.localthe exit 0add startup scripts between statements,

We said here another way, using the update-rc.dcommand to add / disable startup items, very good use.

use

#将脚本添加开机自启,先放入/etc/init.d文件夹,并给予可执行权限
mv xx.sh /etc/init.d
chmod +x  /etc/init.d/xx.sh

#设置开机自启
update-rc.d xx.sh defaults

#删除开机自启
update-rc.d -f xx.sh remove

#如果你想禁止程序开机自启,比如apache2、nginx
update-rc.d -f apache2 remove
update-rc.d -f nginx remove

For some programs sometimes do not want to uninstall, do not want to boot, and quite used to this approach, you can also save CPUutilization of resources.


Disclaimer: This article is the original article, copyright  Rat's Blog  all, please indicate the source!

This link: https://www.moerats.com/archives/577/

 

 

 

 

 

 

Published 218 original articles · won praise 131 · views 30000 +

Guess you like

Origin blog.csdn.net/frdevolcqzyxynjds/article/details/105158386