python程序使用supervisor启停

安装supervisor

复制代码
unzip supervisor-3.3.3.zip
cd supervisor-3.3.3
sudo python2 setup.py install

增加python应用的启动配置

复制代码
[program: xxx]
priority=10
directory=/opt/app/xxx
autostart=true
autosecs=30
autorestart=true
startretries=5
user=app
command=/usr/bin/nohup /usr/local/python3.10/bin/python3.10 -u app.py > xxx.log 2>&1 &

使用

更新supervisor,增加上面的配置

复制代码
sudo supervisorctl update

会输出: xxx: added process group

启动/停止/重启/查看状态:

复制代码
sudo supervisor start/stop/restart/status xxx
相关推荐
小镇敲码人7 小时前
剖析CANN框架中Samples仓库:从示例到实战的AI开发指南
c++·人工智能·python·华为·acl·cann
萧鼎7 小时前
Python 包管理的“超音速”革命:全面上手 uv 工具链
开发语言·python·uv
alvin_20057 小时前
python之OpenGL应用(二)Hello Triangle
python·opengl
铁蛋AI编程实战7 小时前
通义千问 3.5 Turbo GGUF 量化版本地部署教程:4G 显存即可运行,数据永不泄露
java·人工智能·python
jiang_changsheng8 小时前
RTX 2080 Ti魔改22GB显卡的最优解ComfyUI教程
python·comfyui
0思必得08 小时前
[Web自动化] Selenium处理滚动条
前端·爬虫·python·selenium·自动化
沈浩(种子思维作者)9 小时前
系统要活起来就必须开放包容去中心化
人工智能·python·flask·量子计算
2301_790300969 小时前
Python数据库操作:SQLAlchemy ORM指南
jvm·数据库·python
m0_736919109 小时前
用Pandas处理时间序列数据(Time Series)
jvm·数据库·python
getapi9 小时前
实时音视频传输与屏幕共享(投屏)
python