Linux进程守护

crontab

service

edit /etc/systemd/system/x.service

[Unit]
Description=ServerStatus.chyi.org
After=network.service

[Service]
Type=simple
ExecStart=/usr/bin/python2.7 /root/Git/serverstatus/client-linux.py
Restart=on-failure

[Install]
WantedBy=multi-user.target

start and enable

systemctl start x
systemctl enable x

reload to update

systemctl daemon-reload
systemctl start x
systemctl status x
systemctl restart x
systemctl stop x

supervisor

install

apt-get install supervisor
pip3 install supervisor
yum install supervisor

已发布

分类

来自

标签:

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注