monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [monit] monit start at boot and respawning on Ubuntu hardy?


From: Martin Pala
Subject: Re: [monit] monit start at boot and respawning on Ubuntu hardy?
Date: Sat, 20 Sep 2008 22:19:04 +0200

This is sample script to start monit using upstart:

--8<--
# This is an event.d (upstart) script to keep monit running
# To install disable the old way of doing things:
#
#   /etc/init.d/monit stop && update-rc.d -f monit remove
#
# then put this script here: /etc/event.d/monit
#
# You can manually start and stop monit like this:
#
# start monit
# stop monit
#
# Michael Hale (http://halethegeek.com)

start on runlevel 2
start on runlevel 3
start on runlevel 4
start on runlevel 5

stop on runlevel 0
stop on runlevel 6

exec /usr/sbin/monit -Ic /etc/monit/monitrc
instance
respawn
--8<--

On Sep 18, 2008, at 11:55 PM, Stan Kaufman wrote:

What is the proper way to get monit to launch at boot and to respawn if
monit crashes on Ubuntu hardy, which doesn't use inittab?

With Debian etch, it’s easy since Debian still uses /etc/inittab — but
Ubuntu has abandoned this in favor of upstart and configs to be made
(apparently) in /etc/default and maybe /etc/event. This discussion
(http://www.ubuntugeek.com/monitoring-ubuntu-services-using- monit.html)
says that simply setting startup=1 in /etc/default/monit will cause
monit to start, but this appears not to be the case. This writeup says
nothing about using update-rc.d to install links in the various runlevel
directories.

I’ve compiled and installed monit 4.10.1 (the latest stable version),
and it runs fine from the command line (sudo /etc/init.d/monit start).
However, when I reboot, monit does not start — unless I add the
update-rc.d links. Was this step simply missing from the above otherwise
authoritative-sounding writeup?

Even if the update-rc.d step should be used to launch monit at boot,
what about respawning monit? The inittab approach restarts monit if it
dies for some reason. What is the Ubuntu Way to accomplish this? Surely
there must be a way, or is this a reason to stick with Debian? Or else
what am I fundamentally not understanding here?

Many thanks in advance!




--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general





reply via email to

[Prev in Thread] Current Thread [Next in Thread]