#!/bin/sh # chkconfig: 35 98 10 # description: Control the task monitor # processname: taskmon # config: /etc/monitortasks.conf # config: /etc/taskmon.conf . /etc/rc.d/init.d/functions # See how we were called. case "$1" in start) echo -n "Starting task monitor: " CYCLE=60 MAIL=root SIGNAL=15 if [ -f /etc/taskmon.conf ] ; then . /etc/taskmon.conf fi /usr/sbin/taskmon --signum $SIGNAL --mail $MAIL --cycle $CYCLE & sleep 1 echo taskmon touch /var/lock/subsys/taskmon ;; stop) echo -n "Stopping taskmon: " killall taskmon rm -f /var/lock/subsys/taskmon sleep 1 echo "taskmon" ;; restart) $0 stop $0 start ;; *) echo "Usage: taskmon {start|stop}" exit 1 esac exit 0