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].
Comments
Post a Comment