Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a django application which is executing a bash script. I require the nginx server to restart so I run /etc/init.d/nginx reload which works great. I have been using restart uwsgi for uwsgi but I need to do a graceful reload instead of a hard server restart.

How can I do this?

I am currently running a bash reload uwsgi function through subprocess.popen. It seems to be only reloading the process that is calling the subprocess not all sites being hosted by the uwsgi instance. importing uwsgi and running uwsgi.reload seems to also only effect the calling process. Is there a switch for either uwsgi through python or bash that allows restarting all uwsgi proces

share|improve this question
up vote 0 down vote accepted

You can do it in python

import uwsgi
share|improve this answer
the uwsgi.reload() is working intermittently. it seems to be restarting the server before some of my processes are finished. i'm running this through a django application and want it to restart the entire server. – darren Jun 2 '11 at 20:35

You can restart uWSGI by sending the SIGHUP signal to your uWSGI process like so:

kill -HUP <process-id>

If you want to automate this in a bash script, you can have uWSGI write away it's process id by supplying the pidfile option, for example like:


Then you can reload the process by:

uwsgi --reload /tmp/

Remember that you can only reload uWSGI when it's running with the master process mode, but that's usually the case though.

More information:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.