update-rc.d詳解 Debian系統啟動腳本
Insert links using the defaults:
? update-rc.d foobar defaults
Equivalent command using explicit argument sets:
? update-rc.d foobar start 20 2 3 4 5 . stop 20 0 1 6 .
More typical command using explicit argument sets:
? update-rc.d foobar start 30 2 3 4 5 . stop 70 0 1 6 .
Remove? all? links? for? a? script? (assuming? foobar? has been deleted
already):
? update-rc.d foobar remove
Example of disabling a service:
? update-rc.d -f foobar remove
? update-rc.d foobar stop 20 2 3 4 5 .
Example of a command for installing a? system? initialization-and-shut‐
down script:
? update-rc.d foobar start 45 S . start 31 0 6 .
Example of a command for disabling a system initialization-and-shutdown
script:
? update-rc.d -f foobar remove
? update-rc.d foobar stop 45 S .
修改LINUX默認啟動級別
# 0 - 停機(千萬不要把initdefault設置為0 )
# 1 - 單用戶模式
# 2 - 多用戶,但是沒有NFS
# 3 - 完全多用戶模式
# 4 - 沒有用到
# 5 - X11
# 6 - 重新啟動(千萬不要把initdefault設置為6 )
# 對各個運行級的詳細解釋:
0 為停機,機器關閉。
1 為單用戶模式,就像Win9x下的安全模式類似。
2 為多用戶模式,但是沒有NFS支持。
3 為完整的多用戶模式,是標準的運行級。
4 一般不用,在一些特殊情況下可以用它來做一些事情。例如在筆記本電腦的電池用盡時,可以切換到這個模式來做一些設置。
5 就是X11,進到X Window系統了。
6 為重啟,運行init 6機器就會重啟。
修改級別
vi /etc/inittab
把id:3:initdefault:中的3改為5就是默認進入圖形界面了