如何使用centos7.X中的systemctl命令
1.查看centos版本:
#cat /etc/redhat-release

2.我們對(duì)service和chkconfig兩個(gè)命令都不陌生,systemctl 是管制服務(wù)的主要工具, 它整合了chkconfig 與 service功能于一體。

systemctl is-enabled iptables.service
systemctl is-enabled servicename.service #查詢服務(wù)是否開(kāi)機(jī)啟動(dòng)
systemctl enable *.service #開(kāi)機(jī)運(yùn)行服?
systemctl disable *.service #取消開(kāi)機(jī)運(yùn)行
systemctl start *.service #啟動(dòng)服務(wù)
systemctl stop *.service #停止服務(wù)
systemctl restart *.service #重啟服務(wù)
systemctl reload *.service #重新加載服務(wù)配置文件
systemctl status *.service #查詢服務(wù)運(yùn)行狀態(tài)
systemctl –failed #顯示啟動(dòng)失敗的服務(wù)
會(huì)員登錄
賬號(hào)登錄還沒(méi)有賬號(hào)?立即注冊(cè)