How to use supervisor fo start/stop uWSGI application?

Bdfy picture Bdfy · Oct 22, 2013 · Viewed 11.5k times · Source

I use a supervisor to run uWSGI application. Why uWSGI application does not always stop after stop supervisor? supervisor config:

[program:test]
autostart = true
user=root
command=uwsgi --master --workers  5 --disable-logging --socket 127.0.0.1:8888
--module web --callable app
priority=1
redirect_stderr=true
stdout_logfile = /data/log

Answer

roberto picture roberto · Oct 22, 2013

By default supervisor send SIGTERM on stop. SIGTERM in uWSGI means 'brutal reload'.

You have to change it to QUIT or INT:

stopsignal=QUIT

should be enough

Another approach (discouraged) is adding --die-on-term to uWSGI command line to change its default behaviour