linux自启动systemctl

(1)systemctl

路径:/etc/systemd/system/下的service

说明:

图片.png

每次更改服务脚本内容后更新:

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


下一篇: