http://man.linuxde.net/systemctl
Systemd 入門教程:實(shí)戰(zhàn)篇:http://www.ruanyifeng.com/blog/2016/03/systemd-tutorial-part-two.html
Systemd 入門教程:命令篇:http://www.ruanyifeng.com/blog/2016/03/systemd-tutorial-commands.html
systemctl命令是系統(tǒng)服務(wù)管理器指令锣枝,它實(shí)際上將 service 和 chkconfig 這兩個(gè)命令組合到一起。
| 任務(wù) | 舊指令 | 新指令 |
| 使某服務(wù)自動(dòng)啟動(dòng) | chkconfig --level 3 httpd on | systemctl enable httpd.service |
| 使某服務(wù)不自動(dòng)啟動(dòng) | chkconfig --level 3 httpd off | systemctl disable httpd.service |
| 檢查服務(wù)狀態(tài) | service httpd status | systemctl status httpd.service (服務(wù)詳細(xì)信息) systemctl is-active httpd.service (僅顯示是否 Active) |
| 顯示所有已啟動(dòng)的服務(wù) | chkconfig --list | systemctl list-units --type=service |
| 啟動(dòng)某服務(wù) | service httpd start | systemctl start httpd.service |
| 停止某服務(wù) | service httpd stop | systemctl stop httpd.service |
| 重啟某服務(wù) | service httpd restart | systemctl restart httpd.service |