(1)systemctl
路径:/etc/systemd/system/下的service
说明:
每次更改服务脚本内容后更新:
systemctl daemon-reload
systemctl enable auto_run_script.service
(2)指令
任务 | 指令 |
使某服务自动启动 | systemctl enable httpd.service |
使某服务不自动启动 | systemctl disable httpd.service |
检查服务状态 | systemctl status httpd.service |
显示所有已启动的服务 | systemctl list-units –type=service |
启动某服务 | systemctl start httpd.service |
停止某服务 | systemctl stop httpd.service |
重启某服务 | systemctl restart httpd.service |