在 Ubuntu 上的 chkconfig 叫作 sysv-rc-conf

回覆文章
tony
文章: 585
註冊時間: 2012-02-26, 07:04
聯繫:

在 Ubuntu 上的 chkconfig 叫作 sysv-rc-conf

未閱讀文章 tony »

記得 RH系列的 chkconfig 指令,靠它讓我可以設定服務在什麼開機模式下啟動服務。但在ubuntu上卻找不到這套件,不過ubuntu也有自己的相關套件「sysv-rc-conf」!!

安裝sysv-rc-conf

$ sudo apt-get install -y sysv-rc-conf

執行

$ sudo sysv-rc-conf

畫面如下 其中"X"表示此runlevel會啟動," “表示不啟動
sysv-rc-conf.png
操作範例說明

$ sysv-rc-conf –list | grep ssh # 查看 ssh run level
ssh 1:off 2:off 3:off 4:off 5:off

$ sudo sysv-rc-conf –level 35 ssh off # 關閉 ssh 3 及 5 的 run level
$ sysv-rc-conf –list | grep ssh
ssh 3:off 5:off

$ sudo sysv-rc-conf atd off # 關閉 atd run level
$ sysv-rc-conf –list | grep atd # 查看 atd run level
atd 1:off 2:off 3:off 4:off 5:off

$ sudo sysv-rc-conf atd on # 開啟 atd run level
$ sysv-rc-conf –list | grep atd # 查看 atd run level
atd 1:off 2:on 3:on 4:on 5:on
回覆文章

誰在線上

正在瀏覽這個版面的使用者:沒有註冊會員 和 2 位訪客