Upstart doesn't like to start gunicorn because it tries to call setpgrp (see github issue), what would be the best way to start [gunicorn] on a 10.04.1 server install? - Ideally with automatic restarting of the failed main process and multiple workers. On the gunicorn site they mention [runit] and [supervisord], is it worthwhile installing another kind of process supervisor alongside ubuntu's upstart?
I'll document progress here after exams if someone doesn't come up with a better solution.
OK I've tried:
respawn
respawn limit 10 5
expect daemon # also tried expect fork
exec python /path/to/manage.py run_gunicorn --daemon
but I can't seem to get the job to start, it just hangs? nothing shows up in ps aux | grep manage or the syslog, I'm guessing upstart isn't catching the fork properly. Is it because I'm using manage.py instead of gunicorn directly? I'll give running it directly a shot as soon as I get a chance.
Clarification: manage.py is from a django 1.2 instance with gunicorn as an installed app, but no special settings in settings.py (I don't know the syntax for specifying gunicorns port/address/workers in settings.py so I was planning to just use cmdline args)