#!/bin/sh # $Id: qmonitor-init,v 1.4 2005/06/13 11:23:22 dws Exp $ # example init script for qmonitor # # chkconfig: 2345 82 28 # description: qmonitor is a postfix queue monitor # # processname: qmonitor.pl # pidfile: /var/run/qmonitor.pid # # qmonitor - by hzqbbc PATH=/bin:/usr/bin MAILGRAPH_PL=/usr/local/mailgraph_ext/qmonitor.pl PID_FILE=/var/run/qmonitor.pid RRD_DIR=/var/lib case "$1" in 'start') echo "Starting queue statistics grapher: qmonitor"; nice -19 $MAILGRAPH_PL -d --daemon-pid=$PID_FILE \ --daemon-rrd=$RRD_DIR ;; 'stop') echo "Stopping queue statistics grapher: qmonitor"; if [ -f $PID_FILE ]; then kill `cat $PID_FILE` rm $PID_FILE else echo "qmonitor not running"; fi ;; 'restart') $0 stop $0 start ;; *) echo "Usage: $0 { start | restart | stop }" exit 1 ;; esac exit 0