Ubuntu进程奔溃自启动管理supervisor
root 用户安装
// Install the supervisor
sudo apt-get install supervisor
使用方法
cd /etc/supervisor/conf.d/
进入/etc/supervisor/conf.d/目录后,创建应用进程配置文件.conf。
touch myApp.conf
添加配置内容:
[program:myApp]
command=python3 -u myApp.py ; 要执行的命令
numprocs=1 ; 启动1个进程
directory=/home/xxx/ ; myApp.py所在的目录
autostart=true ; 自动运行
autorestart=true ; myApp.py程序奔溃,自动重启
startretries=10 ; 最多重启次数
startsecs=3 ; 判定myApp运行成功的时间
exitcodes=0 ; 正常退出代码
stopsignal=

最低0.47元/天 解锁文章
617





