centos查看自啟動服務


 

1,查看自啟動服務?

systemctl list-unit-files --type service |grep enabled

 

2,查看某服務的開機啟動狀態?

systemctl list-unit-files --type service |grep service_name

 

3,啟動(關閉,重啟,查看)某個服務?

(centos6系統):service  service_name  (start|stop|restart|status)

(centos7系統):systemctl  (start|stop|restart|status) service_name

注:centos7系統兼容centos6的啟動命令(即7中可以使用6的命令)。

 

4,設置開機啟動或者關閉某個服務?

(centos6系統):

開機啟動:chkconfig  --add  service_name  或者  chkconfig  service_name  on

開機關閉:chkconfig  --del   service_name  或者  chkconfig  service_name  off

(centos7系統):

開機啟動:systemctl enable  service_name

開機關閉:systemctl disable  service_name


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM