Centos7 查看自啟動列表systemctl list-unit-files以及設置服務自啟動


CentOS7查看自啟列表命令

systemctl list-unit-files

 

執行結果:"enabled:自啟動","disabled:未自啟動"

只查看服務類型的開機啟動

systemctl --type service list-unit-files

重啟或者查看某個服務狀態

systemctl restart abrtd.service 
systemctl status abrtd.service 

設置服務開機啟動

 systemctl enable nginx.service //設置nginx開機啟動
 systemctl enable php-fpm.service  //php-fpm開機啟動

搜索指定狀態的服務

systemctl list-unit-files | grep enabled  //搜索全部已啟動的服務,enabled 啟用;disabled 禁用。

搜索指定服務的狀態

systemctl list-unit-files | grep nginx  //搜索 nginx 的開機啟動狀態

 


免責聲明!

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



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