在Centos7之后Linux启动方式已经用systemd取代init了,systemd主要是通过systemctl这个系统服务管理指令来处理
语法格式:
systemctl [参数] [服务]
常用参数:
-start | 启动服务 | systemctl start httpd |
-stop | 停止服务 | systemctl stop httpd |
-restart | 重启服务 | systemctl restart httpd |
-enable | 将服务加入到开机自启中 | systemctl enable httpd |
-disable | 将服务移出开机自启 | systemctl disable httpd |
-status | 查看该服务的状态 | systemctl status httpd |
-list -units --type=service | 列举所有已启动服务 | systemctl list-units --type=service |
来源:oschina
链接:https://my.oschina.net/u/3199663/blog/3168035