]> git.pld-linux.org Git - packages/monit.git/blobdiff - monit.init
- 5.2.4
[packages/monit.git] / monit.init
index 904511280492eae2a1688b642df58c054e51f26b..f21315568ab827f954f1d56f6abef5a94749c3e4 100644 (file)
@@ -14,7 +14,7 @@
 
 checkconfig() {
        local out
-       out=$(monit -c /etc/monitrc -t 2>&1)
+       out=$(/usr/sbin/monit -c /etc/monitrc -t 2>&1)
        ret=$?
        if [ $ret != 0 ]; then
                echo >&2 "$out"
@@ -27,7 +27,7 @@ start() {
        if [ ! -f /var/lock/subsys/monit ]; then
                checkconfig
                msg_starting monit
-               daemon /usr/sbin/monit -c /etc/monitrc -l syslog -d 60 -s /var/run/monit.state
+               daemon --pidfile /var/run/monit.pid /usr/sbin/monit -c /etc/monitrc -s /var/run/monit.state $OPTIONS
                RETVAL=$?
                [ $RETVAL -eq 0 ] && touch /var/lock/subsys/monit
        else
@@ -39,7 +39,10 @@ stop() {
        # Stop daemons.
        if [ -f /var/lock/subsys/monit ]; then
                msg_stopping monit
-               daemon --waitforname monit --waitfortime 10 monit -c /etc/monitrc quit
+               busy
+               /usr/sbin/monit -c /etc/monitrc quit
+               RETVAL=$?
+               [ $RETVAL -eq 0 ] && ok || fail
                rm -f /var/lock/subsys/monit > /dev/null 2>&1
        else
                msg_not_running monit
@@ -50,10 +53,10 @@ RETVAL=0
 # See how we were called.
 case "$1" in
   start)
-       start
+       start
        ;;
   stop)
-       stop
+       stop
        ;;
   restart)
        checkconfig
@@ -64,8 +67,10 @@ case "$1" in
        if [ -f /var/lock/subsys/monit ]; then
                checkconfig
                msg_reloading monit
-               daemon /usr/sbin/monit -c /etc/monitrc reload
+               busy
+               /usr/sbin/monit -c /etc/monitrc reload
                RETVAL=$?
+               [ $RETVAL -eq 0 ] && ok || fail
        else
                msg_not_running monit
                exit 7
This page took 0.37377 seconds and 4 git commands to generate.