Monit is a software watchdog – a very useful tool to keep your service daemons alive.
The best way to run monit is as the Init managed process. But there is no /etc/inittab on Ubuntu anymore. Instead we have Upstart. Adding Monit as an Upstart service is easy. Let me show you how…
Upstart is event based, and its event handling configuration is in /etc/event.d. The configuration is a bit similar to /etc/inittab, but a bit more verbose and placed in separate files. To add Monit as a managed process, just create a file similar to a getty spawner configuration in ttyX. I named my file: /etc/event.d/monit with content of:
# Run monit in standard run-levels
start on stopped rc2
start on stopped rc3
start on stopped rc4
start on stopped rc5
stop on runlevel 0
stop on runlevel 1
stop on runlevel 6
respawn
exec /usr/sbin/monit -Ic /etc/monit/monitrc
Next just start monit. Issue a command:
start monit
Good luck with service monitoring.

But… what do you need monit for, when you have upstart?
Can Upstart check whether a deamon prompts a defined string on TCP port?
Can Upstart alert you on high server load then find and kill misbehaving process?
Can Upstart fix and report resource limits?
I could go on… ;-)
Thanks fpr the upstart script. :-)