启动
来自Ubuntu中文
Ubuntu 系统的启动流程、增/删启动项
init
Linux 内核启动 init ,init进程ID是1。
runlevel
查看当前的运行级别,Ubuntu 桌面默认是2。
runlevel
sysv-rc-conf
查看/修改不同运行级别的启动项,可以发现Ubuntu(其实是Debian)2-5之间的runlevel效果是一样的。
sudo apt-get install sysv-rc-conf
sudo sysv-rc-conf
/etc/rc2.d
update-rc.d
添加启动项,例如mysql
qii@ubuntu:/etc/rc2.d$ sudo update-rc.d mysql defaults update-rc.d: warning: /etc/init.d/mysql missing LSB information update-rc.d: see <http://wiki.debian.org/LSBInitScripts> Adding system startup for /etc/init.d/mysql ... /etc/rc0.d/K20mysql -> ../init.d/mysql /etc/rc1.d/K20mysql -> ../init.d/mysql /etc/rc6.d/K20mysql -> ../init.d/mysql /etc/rc2.d/S20mysql -> ../init.d/mysql /etc/rc3.d/S20mysql -> ../init.d/mysql /etc/rc4.d/S20mysql -> ../init.d/mysql /etc/rc5.d/S20mysql -> ../init.d/mysql
删除启动项
qii@ubuntu:/etc/rc2.d$ sudo update-rc.d -f mysql remove Removing any system startup links for /etc/init.d/mysql ... /etc/rc0.d/K20mysql /etc/rc1.d/K20mysql /etc/rc2.d/S20mysql /etc/rc3.d/S20mysql /etc/rc4.d/S20mysql /etc/rc5.d/S20mysql /etc/rc6.d/K20mysql
rcconf
sudo apt-get install rcconf
sudo rcconf