At work, we run our systems on Ubuntu, which so far means the init system is Upstart. I needed to have one binary to start when the system boots, and because I'm horrified by sysvinit scripts (which Upstart supports), I decided to give creating an Upstart job a try. I was surprised how easy it was:
exec /usr/local/bin/executable start on startup respawn
I placed a file with above contents in
that's pretty much it. Impressive.
Here's what happens:
execinstructs Upstart what executable to run
start onis an instruction on when to start the service
respawnmeans the service should re-start if ever it dies for some reason
One convenient thing that's happening is that stdout output of the
service gets re-directed to a log file, in this case
/var/log/upstart/executable.log. Cool stuff.