python / 常用操作 · 12月 20, 2022 0

supervisord 常用操作 运行python脚本

内容纲要

how toinstall

apt-get install supervisor

[program:my_server]
command=python /path/to/server.py
directory=/path/to/server/
autostart=true
autorestart=true
stdout_logfile=/var/log/server.log
stderr_logfile=/var/log/server_error.log
user=your_linux_user_name

复制配置

cp supervisord.conf /etc/supervisor/conf.d
supervisorctl reload

查看状态

supervisord

服务操作

sudo service supervisor stop
sudo service supervisor start
sudo service supervisor restart

"Error: Another program is already listening on a port that one of our HTTP servers is configured to use. Shut this program down first before starting supervisord.":

sudo unlink /tmp/supervisor.sock
sudo unlink /var/run/supervisor.sock

http://supervisord.org/

%d 博主赞过: