[Top][All Lists]

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

[monit] how best to start/stop via monit on Ubuntu hardy -- cf FAQ quest

From: Stan Kaufman
Subject: [monit] how best to start/stop via monit on Ubuntu hardy -- cf FAQ question 7
Date: Tue, 16 Sep 2008 17:47:03 -0700
User-agent: Thunderbird (Macintosh/20080707)

Question 7 of the FAQ ( advises starting critical services with monit by starting/stopping monit in inittab or else by adding a line to monit's "rc script" (to stop these services politely before monit stops). Ubuntu has abandoned inittab, and the FAQ isn't precise as to how the suggested line:

/usr/local/bin/monit -c /etc/monitrc stop all

should be added -- or even precisely which file to add it to.

Should this be added to


? This seems unlikely, as there are no such system calls in this script.

Should this instead be added to


? This seems more likely, but exactly where would this go? Something like this, where the monit stop all call is right before the start-stop-daemon call that stops monit?

case "$1" in
       echo -n "Starting $DESC: "
   monit_checks $1
       echo -n "$NAME"
       start-stop-daemon --start --quiet --pidfile /var/run/$ \
               --exec $DAEMON > /dev/null 2>&1 -- $ARGS
       echo "."
       echo -n "Stopping $DESC: "
   #monit_checks $1
       echo -n "$NAME"
       /usr/local/bin/monit -c /etc/monitrc stop all
start-stop-daemon --retry 5 --oknodo --stop --quiet --pidfile /var/run/$ \
               --exec $DAEMON  > /dev/null 2>&1
       echo "."
       $0 stop
       $0 start
       echo "Usage: $N {start|stop|restart|force-reload|syntax}" >&2
       exit 1

Something else? Many thanks in advance for definitive guidance here!

reply via email to

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