Source

django-in-a-box / docs / wiki / tools / supervisor.md

Supervisor

Supervisor is a tool for starting, stopping and managing processes. It is used in Django-in-a-Box to manage the lighttpd and FastCGI processes. You can also run daemons like task queues and various workers.

In the initial DiaB setup, Supervisor is configured with a program called memmon which will kill any runaway processes (by default, those with a memory consumption greater than 300MB). For more information on configuring the memmon command, consult the documentation at the Superlance PyPI page.

The Supervisor Manual provides far better documentation than I can hope to provide here. I can, however, offer some good recipes for Django-in-a-Box:

# Start Supervisor
$ supervisord

# Check Supervisor’s status
$ supervisorctl status

# Restart lighttpd
$ supervisorctl restart lighttpd

# Restart all FastCGI workers. If you have customised the FastCGI 
# `program_name` setting in `pavement.py`, replace `django` with the custom 
# value.
$ supervisorctl restart django:*

# Shut down Supervisor
$ supervisorctl shutdown

If you ever run supervisorctl and receive an error message ending with:

socket.error: [Errno 61] Connection refused

That usually means that Supervisor is not running. Check the site_dir/log/supervisord.log file for more information if this error persists.

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.