syetemctl就是service和chkconfig這兩個命令的整合,在CentOS 7就開始被使用了。
systemctl 是系統服務管理器命令,它實際上將 service 和 chkconfig 這兩個命令組合到一塊兒。centos
(一)對比centos7
任務 | 舊指令(centos六、5) | 新指令(centos7) |
顯示全部已啓動的服務 | chkconfig --list | systemctl list-units --type=service --all查看全部服務: systemctl list-units --type=service --all |
使某服務自動啓動 | chkconfig --level 3 httpd on | systemctl enable httpd.service |
使某服務不自動啓動 | chkconfig --level 3 httpd off | systemctl disable httpd.service |
檢查服務狀態 | service httpd status | systemctl status httpd.service (服務詳細信息) systemctl is-active httpd.service (僅顯示是否 Active) |
啓動某服務 | service httpd start | systemctl start httpd.service |
中止某服務 | service httpd stop | systemctl stop httpd.service |
重啓某服務 | service httpd restart | systemctl restart httpd.service |
(二)擴展spa
centos7中rest
yum install -y A #安裝ci
systemctl status A # 管理it
systemctl start A table
systemctl stop A 擴展
systemctl restart A service
systemctl enable A yum
systemctl disable A
systemctl list-units --type=service # 查看全部開機自動啓動的服務