[Unit]
Description=pysql
After=network-online.target
[Service]
Type=simple
WorkingDirectory=/home/zc/web
ExecStart=/usr/bin/python3.7 /home/zc/web/web_run.py > 1>/dev/null 2>&1
Restart=always
User=zc
[Install]
WantedBy=multi-user.target
/lib/systemd/system
配置开机启动
systemctl enable supervisord.service
或者
systemctl enable supervisord
还有其他其他命令
systemctl start/restart/stop supervisor.service
验证一下是否为开机启动:
systemctl is-enabled supervisord
重新启动服务
systemctl restart supervisord
查看所有已启动的服务
systemctl list -units --type=service
停止开机自启动
systemctl disable nfs-server.service
查看服务当前状态
systemctl status nfs-server.service————————————————
版权声明:本文为CSDN博主「diyiday」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/diyiday/article/details/79817905