前言
yum install supervisor
sudo apt install supervisor
systemctl enable supervisor
配置文件
路径
cd /etc/supervisor/conf.d/
内容
[program:myWs]
directory=/root/ws/myWs
command=/root/anaconda2/envs/tornado/bin/python main.py
autostart=true
autorestart=false
startretries=3
startsecs=1
priority=999
stderr_logfile=/dev/null
stdout_logfile=/dev/null
user = root
redirect_stderr = true
asgfjfghfc_maxbytes = 20M
stdout_logfile_backups = 20
常用命令
ps -ef | grep supervisord | grep -v grep | awk '{print $2}' | xargs kill
supervisord -c /etc/supervisor/supervisord.conf
supervisorctl status
supervisorctl restart all/myWs
supervisorctl reread
supervisorctl update
supervisorctl reload