summaryrefslogtreecommitdiff
path: root/monit/monitd
blob: a3700ff07276e9d8a7731a9f108d1d168f9cf318 (plain)
    1 #!/bin/sh
    2 #
    3 # /etc/rc.d/monitd: start/stop monit daemon
    4 #
    5 
    6 SSD=/sbin/start-stop-daemon
    7 PROG=/usr/bin/monit
    8 PID=/var/run/monit.pid
    9 OPTS="-c /etc/monitrc -p $PID"
   10 
   11 case $1 in
   12 start)
   13 	$SSD --start --pidfile $PID --exec $PROG -- $OPTS
   14 	;;
   15 stop)
   16 	$SSD --stop --retry 10 --pidfile $PID
   17 	;;
   18 restart)
   19 	$0 stop
   20 	$0 start
   21 	;;
   22 reload)
   23 	$PROG $OPTS reload
   24 	;;
   25 status)
   26 	$SSD --status --pidfile $PID
   27 	case $? in
   28 	0) echo "$PROG is running with pid $(cat $PID)" ;;
   29 	1) echo "$PROG is not running but the pid file $PID exists" ;;
   30 	3) echo "$PROG is not running" ;;
   31 	4) echo "Unable to determine the program status" ;;
   32 	esac
   33 	;;
   34 *)
   35 	echo "usage: $0 [start|stop|restart|reload|status]"
   36 	;;
   37 esac
   38 
   39 # End of file

Generated by cgit