diff --git a/doc/site/deployment.rst b/doc/site/deployment.rst index 02158ba7..ce415bc1 100644 --- a/doc/site/deployment.rst +++ b/doc/site/deployment.rst @@ -80,7 +80,20 @@ A popular method for deploying Gunicorn is to have it monitored by runit_. An `e cd $ROOT exec $GUNICORN -C $ROOT/gunicorn.conf.py --pidfile=$PID $APP +Another useful tool to monitor and control Gunicorn is Supervisor_. An +`example configuration`_ is:: + + [program:gunicorn] + command=/usr/local/bin/gunicorn main:application -C /path/to/project/gunicorn.conf.py + directory=/path/to/project + user=nobody + autostart=true + autorestart=true + redirect_stderr=True + .. _Nginx: http://www.nginx.org .. _`example configuration`: http://github.com/benoitc/gunicorn/blob/master/examples/nginx.conf .. _runit: http://smarden.org/runit/ -.. _`example service`: http://github.com/benoitc/gunicorn/blob/master/examples/gunicorn_rc \ No newline at end of file +.. _`example service`: http://github.com/benoitc/gunicorn/blob/master/examples/gunicorn_rc +.. _Supervisor: http://supervisord.org +.. _`example configuration`: http://github.com/benoitc/gunicorn/blob/master/examples/supervisor.conf diff --git a/examples/supervisor.conf b/examples/supervisor.conf new file mode 100644 index 00000000..ab1510bf --- /dev/null +++ b/examples/supervisor.conf @@ -0,0 +1,7 @@ +[program:gunicorn] +command=/usr/local/bin/gunicorn main:application -C /path/to/project/gunicorn.conf.py +directory=/path/to/project +user=nobody +autostart=true +autorestart=true +redirect_stderr=True