6661928
#!/bin/sh
6661928
#
6661928
# npcd         Nagios Performancedata C Daemon
6661928
#
6661928
# chkconfig:   - 98 02
6661928
# description: Nagios Performancedata C Daemon
6661928
6661928
### BEGIN INIT INFO
6661928
# Provides: 
6661928
# Required-Start: 
6661928
# Required-Stop: 
6661928
# Should-Start: 
6661928
# Should-Stop: 
6661928
# Default-Start: 
6661928
# Default-Stop: 
6661928
# Short-Description: 
6661928
# Description:      
6661928
### END INIT INFO
6661928
6661928
# Source function library.
6661928
. /etc/rc.d/init.d/functions
6661928
6661928
exec="/usr/sbin/npcd"
6661928
prog="npcd"
6661928
config="/etc/pnp4nagios/npcd.cfg"
6661928
6661928
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
6661928
6661928
lockfile=/var/lock/subsys/$prog
6661928
6661928
start() {
6661928
    [ -x $exec ] || exit 5
6661928
    [ -f $config ] || exit 6
6661928
    echo -n $"Starting $prog: "
6661928
    daemon $exec -f $config -d
6661928
    retval=$?
6661928
    echo
6661928
    [ $retval -eq 0 ] && touch $lockfile
6661928
    return $retval
6661928
}
6661928
6661928
stop() {
6661928
    echo -n $"Stopping $prog: "
6661928
    killproc $prog
6661928
    retval=$?
6661928
    echo
6661928
    [ $retval -eq 0 ] && rm -f $lockfile
6661928
    return $retval
6661928
}
6661928
6661928
restart() {
6661928
    stop
6661928
    start
6661928
}
6661928
6661928
reload() {
6661928
    restart
6661928
}
6661928
6661928
force_reload() {
6661928
    restart
6661928
}
6661928
6661928
rh_status() {
6661928
    status $prog
6661928
}
6661928
6661928
rh_status_q() {
6661928
    rh_status >/dev/null 2>&1
6661928
}
6661928
6661928
6661928
case "$1" in
6661928
    start)
6661928
        rh_status_q && exit 0
6661928
        $1
6661928
        ;;
6661928
    stop)
6661928
        rh_status_q || exit 0
6661928
        $1
6661928
        ;;
6661928
    restart)
6661928
        $1
6661928
        ;;
6661928
    reload)
6661928
        rh_status_q || exit 7
6661928
        $1
6661928
        ;;
6661928
    force-reload)
6661928
        force_reload
6661928
        ;;
6661928
    status)
6661928
        rh_status
6661928
        ;;
6661928
    condrestart|try-restart)
6661928
        rh_status_q || exit 0
6661928
        restart
6661928
        ;;
6661928
    *)
6661928
        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
6661928
        exit 2
6661928
esac
6661928
exit $?