sweeeeeet
sweeeeeet

Reputation: 1819

launching program through sh script in Supervisord

I have a script run.sh which launches a python pub-sub listener as follows:

export MY_ENV_VAR='/root/config/'
python /usr/local/lib/python2.7/dist-packages/listener/main.py

And I setup Supervisord so that it allows me to run my script as follows:

[program:Listener]
command=/bin/bash run.sh
directory=/root/listener
process_name=%(program_name)s
autostart=true
autorestart=true
startretries=3

My question is: when I go to my Supervisord UI at port 9001, and press STOP next to the Listener line, do I really stop my Listener? I have the impression that since supervisord is pointing to the .sh script, it does not stop the python script when I click on STOP.

Upvotes: 1

Views: 504

Answers (1)

Alex Pertsev
Alex Pertsev

Reputation: 948

You can try to specify

stopasgroup=true

parameter in your configuration file.

So supervisord will send kill signal to child processes too:

http://supervisord.org/configuration.html

Upvotes: 1

Related Questions