3

I have been using UWSGI behind Nginx and I've set supervisord to restart the Nginx and UWSGI instances in case of a server reboot.

I am debugging my application and sometimes need to reload the application. According to this page I should be sending SIGHUP in order to do a graceful reload.

I could find a stopsignal config setting on this page, but I couldn't find any entry related to something like "reloadsignal" or "restartsignal".

Any ideas?

keremulutas
  • 171
  • 2
  • 4

4 Answers4

2
stopsignal

    The signal used to kill the program when a stop is requested. 
    This can be any of TERM, HUP, INT, QUIT, KILL, USR1, or USR2.

    Default: TERM

    Required: No.

    Introduced: 3.0

stopsignal=HUP is what you're looking for:

[program:uwsgi]
user = uwsgi
command=/usr/sbin/uwsgi ...
autostart=true
autorestart=true
stderr_logfile = /var/log/uwsgi/err.log
stdout_logfile = /var/log/uwsgi/out.log
stopsignal=HUP
quanta
  • 51,413
  • 19
  • 159
  • 217
  • When I test this, it said my UWSGI process is "stopped", not running or restarted. Besides, pressing "stop" button and expecting a reload? Doesn't make that much sense. But, thanks for the effort :) – keremulutas Sep 02 '12 at 14:36
1

I've reported an issue on this here, I hope it will be accepted as a feature request and we all have the chance to use that power.

keremulutas
  • 171
  • 2
  • 4
0

If you run supervisorctl status you'll see the pid of the uwsgi process. Something like this,

$ supervisorctl status
uwsgi                           RUNNING    pid 25700, uptime 0:15:48

All you need to do is send HUP signal manually to this pid.

kill -HUP 25700

You can automated it by,

supervisorctl status signal | grep -o 'pid\s\+\d*'| awk '{print $2}' | xargs -n 1  kill -HUP
Shiplu Mokaddim
  • 893
  • 2
  • 9
  • 14
-1

After using this supervisorctl status signal | grep -o 'pid\s+\d*'| awk '{print $2}' | xargs -n 1 kill -HUP for graceful reload Nginx was not being able to get connection from upstream