天天看點

linux 服務管理工具,四、Linux的系統服務管理工具(systemd)

在centos7及以後,重要的改變就是使用systemd管理機制,目前大多數linux發行版都支援systemd管理機制。

是以systemd不僅能夠初始化系統開機,還能管理linux系統服務。

為了便于linux使用者作業系統服務的管理,systemd提供了systemctl指令工具進行systemd的各項操作。

常用功能:啟動start、停止stop、重新開機服務restart,任何一個軟體或者服務,你都可以嘗試着敲入指令systemctl restart 服務名.service

例如:

systemctl start httpd.service    啟動 httpd服務

systemctl stop httpd.service 停止 httpd服務

systemctl restart httpd.service 重新啟動服務

systemctl try-start httpd.service 服務在運作狀态下重新啟動服務

systemctl reload httpd.service  重新加載配置檔案

檢視、禁止、啟用服務

systemctl endable httpd.service   表示httpd服務開機啟動

systemctl disable httpd.service   表示httpd服務開機關閉

systemctl status  httpd.service   檢視httpd服務狀态,是否開啟

内容來源于網絡如有侵權請私信删除