Simple upstart script

All upstart scripts must be placed in

etc/init/

and must be owned by root. The script filename must end in .conf

A simple upstart scrip can look like this

start on startup
setgid foo
setuid foo
respawn
respawn limit 15 60
exec <my-app>
start on startup

This entry tells upstart to run the application on startup. This can be a run-level specification as well.

setgid foo
setuid foo

Sets user and group id if needed.

respawn
respawn limit 15 60

Upstart will restart the application if it dies, but will stop if if restarts 15 times within 60 seconds.