python - Tornado doesn't restart cleanly in supervisor -


i'm using tornado run flask app, , have shell script little work , runs app.

#!/usr/bin/env bash some_work more_work python /usr/share/theapp/theapp.py 

i use supervisor manage little script. starting works fine (sudo supervisorctl start theapp.sh), when want restart, python subprocess doesn't exit , hangs around, occupying port , preventing startup again. i've tried adding traps ensure python code stopped when script stopped supervisor, hasn't worked. i've tried switching out tornado gevent's wsgi server , have had same problem. how should doing small script?

the term signal sent bash script theapp.sh , never received python process. can try stopasgroup option in program section of supevisor config, more compatible how bash (and other shells) handle signals[1].

[1] http://www.vidarholen.net/contents/blog/?p=34


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -