一、CentOS7 systemctl
在CentOS7中,進行chkconfig命令操作時會發現有類似“systemctl.....”的提示,systemctl可以簡單實現service和chkconfig的結合,這樣通過一個命令就可以實現兩個命令的功能。
systemctl命令的基本操作格式是:
systemctl [OPTIONS...] {COMMAND}...
以nginx服務為例,實現停止、啟動、重啟的動作如下:
systemctl stop nginx.service
systemctl start nginx.service
systemctl restart nginx.service
檢查服務狀態
systemctl status nginx.service
使服務開機啟動
systemctl enable nginx.service
取消服務開機啟動
systemctl disable nginx.service
二、CentOS 7 firewalld