reliably restarting services using upstart or runit
I want to reliably restart my app and web server processes on crash.
If I understand correctly, runit starts every service as a child process. If the child process crashes this sends a signal to the parent process which in turn respawns the service as a child.
How does this work in the case of upstart. Does it also spawn a child process like runit?
I am considering using runit for this. Is that needed, or is upstart good enough for this ?
I am using nginx for my web server and gunicorn (python) for my app server.
Upstart is perfect for it, see respawn
stanza: http://upstart.ubuntu.com/cookbook/#respawn. Upstart is an init process, pid 1, parent of all other processes.