#! /bin/sh # monit: Monit # # chkconfig: - 86 14 # description: monit # processname: monit # # Author: Gabriel Handford http://ducktyper.com # Source function library . /etc/rc.d/init.d/functions RETVAL=0 DESC="monit" NAME=monit DAEMON=/usr/local/bin/monit CONFFILE=/etc/monitrc LOGFILE=<%= monit_log_path %> PIDFILE=<%= monit_pid_path %> start() { echo -n $"Starting $DESC: " daemon $DAEMON -l $LOGFILE -p $PIDFILE -c $CONFFILE RETVAL=$? echo return $RETVAL; } stop() { echo -n $"Stopping $DESC: " killproc -p $PIDFILE monit -TERM RETVAL=$? echo return $RETVAL; } reload() { echo -n $"Reloading $DESC: " killproc -p $PIDFILE monit -HUP RETVAL=$? echo return $RETVAL; } case "$1" in start) start ;; stop) stop ;; reload) reload ;; restart) stop sleep 1 start ;; *) echo "Usage: $0 {start|stop|restart|reload}" >&2 RETVAL=3; ;; esac exit $RETVAL;