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
相关推荐
未知鱼1 天前
Python安全开发asyncio(异步IO与高并发)
python·安全·网络安全·github
代码探秘者1 天前
【大模型应用】5.深入理解向量数据库
java·数据库·后端·python·spring·面试
小鸡吃米…1 天前
Python 网络爬虫
开发语言·爬虫·python
2401_832035341 天前
使用Python处理计算机图形学(PIL/Pillow)
jvm·数据库·python
dapeng28701 天前
Django全栈开发入门:构建一个博客系统
jvm·数据库·python
PNP Robotics1 天前
PNP机器人分享Frankal机器人等具身案例开发和实践
大数据·python·学习·机器人·开源
sin°θ_陈1 天前
CVPR 2026的3DGS卷到什么地步?工程语义上探:BrepGaussian如何打通图像到CAD的最后一公里?(Part III 1-3)
python·深度学习·算法·机器学习·3d·webgl
Fairy要carry1 天前
面试-Agent如何压缩上下文
python
chushiyunen1 天前
python3和python2的区别
开发语言·python
张张123y1 天前
AI Agent Memory:从理论到实战,掌握长短期记忆的核心技术【2】
人工智能·python·langchain·transformer