Process Managers: The Good, the Bad, and the Ugly
blog.crocodoc.com
blog.crocodoc.com
BTW, runit also comes with svlogd and chpst, both of which have frequently proved invaluable. The latter is useful in its own right.
Most of the tools discussed either lack flexibility, try to do too much, or simply don't offer any benefits over runit and company.
http://jtimberman.housepub.org/blog/2012/12/29/process-super...
tl;dr use runit
#!/bin/sh
source /etc/myservice/defaults
exec celeryd $@
And start that from supervisord.Also, another nice thing, very useful for daemons that spawn their own subprocesses is killasgroup option. This is worth mentioning given the celery examples - celery can and will leave orphan processes around between restarts ...
while true:
pid = fork()
if pid: # parent
wait(pid)
else: # child
exec("/path/to/supervised/process")
The key here is not to let the supervised process daemonize itself. If it does, the parent can no longer wait() on the child.Needing to run "nginx -t" instead of "/etc/init.d/nginx configtest" seems like a minor tradeoff for the benefits Upstart provides. It's even shorter to type!
One of the most interesting features, for me, is that Supervisor has an XML-RPC interface[1], allowing for some creative interaction with supervisor and the processes it manages.