
各種較舊的 Linux 發行版,支持系統V鍵入init
腳本,需要將 LSB 標頭新增至init
腳本。例如/etc/init.d/sshd
OpenSUSE 11.4 中的 LSB 標頭:
### BEGIN INIT INFO
# Provides: sshd
# Required-Start: $network $remote_fs
# Required-Stop: $network $remote_fs
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Description: Start the sshd daemon
### END INIT INFO
但是,init
腳本應該是簡單的 bash 腳本,其中以 開頭的每一行#
都是註解。哪個實用程式會讀取這些 LSB 標頭?
答案1
在 debian 上,它是update-rc.d
調用的insserv
(通常不直接運行)。在 Suse 上可能是這樣chkconfig
。你可以在這裡讀到它:蘇塞11
(註:這一切在 openSUSE 12 中發生了變化,現已採用systemd
)。