supervisor如何使用

python -m pip install supervisor
安装的supersorvisor如果在/usr/local/python37/bin下面,将所有supervisor相关文件复制到/usr/bin下面即可正常使用
echo_supervisord_conf > /etc/supervisord.conf 生成配置文件
vi /etc/supervisord.conf 修改配置文件
添加服务
[program:serve1]
command=python /home/serve1.py --port=8887 ; the program (relative uses PATH, can take args)
umask=022                     ; umask for process (default None)
autostart=true                ; start at supervisord start (default: true)
startsecs=5                   ; # of secs prog must stay up to be running (def. 1)
startretries=3

supervisord -c /etc/supervisord.conf 启动 如果已配置supervisor, 将服务重启 supervisorctl restart serve1

 

posted @ 2022-04-19 14:23  不要不说  阅读(28)  评论(0编辑  收藏  举报