Python 通过Supervisord中的sh脚本启动程序
我有一个脚本run.sh,它启动python发布子侦听器,如下所示:Python 通过Supervisord中的sh脚本启动程序,python,sh,supervisord,Python,Sh,Supervisord,我有一个脚本run.sh,它启动python发布子侦听器,如下所示: export MY_ENV_VAR='/root/config/' python /usr/local/lib/python2.7/dist-packages/listener/main.py [program:Listener] command=/bin/bash run.sh directory=/root/listener process_name=%(program_name)s autostart=true aut
export MY_ENV_VAR='/root/config/'
python /usr/local/lib/python2.7/dist-packages/listener/main.py
[program:Listener]
command=/bin/bash run.sh
directory=/root/listener
process_name=%(program_name)s
autostart=true
autorestart=true
startretries=3
我设置了Supervisord,这样它就可以按如下方式运行我的脚本:
export MY_ENV_VAR='/root/config/'
python /usr/local/lib/python2.7/dist-packages/listener/main.py
[program:Listener]
command=/bin/bash run.sh
directory=/root/listener
process_name=%(program_name)s
autostart=true
autorestart=true
startretries=3
我的问题是:当我转到端口9001的Supervisord UI,并按下侦听器行旁边的
STOP
时,我真的停止了侦听器吗?我的印象是,由于supervisord指向.sh
脚本,当我单击stop
时,它不会停止python脚本,您可以尝试指定
stopasgroup=true
配置文件中的参数
因此,supervisord也将向子进程发送终止信号: