深度阅读

supervisord 常用操作 运行python脚本

作者
作者
2023年08月22日
更新时间
8.65 分钟
阅读时间
0
阅读量

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/

博客作者

热爱技术,乐于分享,持续学习。专注于Web开发、系统架构设计和人工智能领域。