在centos中設定程式隨機啟動

2021-07-04 07:23:55 字數 955 閱讀 2054

在centos中設定程式隨機啟動–chkconfig

pony0212

安裝centos 後 某些服務不是自動啟動

chkconfig 可以檢查和 設定服務自動啟動

#chkconfig –list

輸出 所有服務列表

如果列表中沒有你要啟動的服務

可以使用

#chkconfig –add 新增進去:

#chkconfig –add memcached

刪除自然就是

#chkconfig –del 新增進去:

#chkconfig –del memcached

–list 後面可以加 服務名稱 就只輸出此服務的資訊

例如#chkconfig –list httpd

上面的輸出 0-6 都為off 時 表示 沒有自動啟動

0-6 分別表示的是

等級0表示:表示關機

等級1表示:單使用者模式

等級2表示:無網路連線的多使用者命令列模式

等級3表示:有網路連線的多使用者命令列模式

等級4表示:不可用

等級5表示:帶圖形介面的多使用者模式

等級6表示:重新啟動

就可以把httpd服務 設定為自動啟動了

再次檢視

這個時候2~5都是on,設定成功。

相反的#chkconfig httpd off 就是 關閉自動啟動

最後 還有個 –level 應該是對 0-6 某些 等級進行單獨設定

#chkconfig –level 16 httpd on 將1和6 設定成on

RabbitMq 在centos中開機自啟動

1.在 etc init.d 目錄下新建乙個 rabbitmq root localhost init.d vi rabbitmq 檔案內容 bin bash chkconfig 2345 6161 export home opt data rabbitmq export path path usr...

centos設定程式開機自啟或禁止載入

vim etc rc.d rc.local usr local apache bin apachectl start 1 chkconfig level 0123456 service name on off chkconfig level 23 dhcp3 server off 設定dhcp se...

CentOS 設定 ogg mgr 開機自啟

試驗環境 試驗環境 軟體版本 作業系統 centos 7 ogg安裝目錄 home oracle ggs 資料庫oracle 建立 info.txt 檔案 oracle custom04 touch info.txt 編輯 info.txt 檔案 oracle custom04 nano info....