1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
#!/bin/sh
#
# $Id: watchcatd.init 1654 2006-05-29 18:18:02Z andre $
#
# chkconfig: 12345 02 98
# description: Software watchcat, but less drastic than the usual solutions.
#
# processname: watchcatd
# config: /etc/watchcatd.conf
# config: /etc/sysconfig/watchcatd
#
MASTER_PROG=/usr/lib/watchcatd/catmaster
CONFIG_FILE=/etc/watchcatd.conf
SYSCONFIG_FILE=/etc/sysconfig/watchcatd
# Source function library.
. /etc/rc.d/init.d/functions
[ -x ${MASTER_PROG} -a -e ${CONFIG_FILE} ] || exit 0
OPTIONS=""
if [ -f ${SYSCONFIG_FILE} ]; then
. ${SYSCONFIG_FILE}
fi
# See how we were called.
case "${1}" in
start)
gprintf "Starting watchcatd: "
daemon /usr/lib/watchcatd/catmaster ${OPTIONS} &&
touch /var/lock/subsys/watchcatd
echo
;;
stop)
gprintf "Stopping watchcatd: "
killproc catmaster
rm -f /var/lock/subsys/watchcatd
echo
;;
restart|reload)
$0 stop
$0 start
;;
status)
echo "Watchcatd status:"
/usr/sbin/wcatstat
if [ "$?" != "0" ]; then
echo -n "Watchcatd is *not* running"
if [ -f "/var/lock/subsys/watchcatd" ]; then
echo " but /var/lock/subsys/watchcatd still exists."
else
echo "."
fi
fi
;;
*)
gprintf "Usage: watchcatd {start|stop|restart|reload|status}\n"
exit 1
;;
esac
exit 0
|