Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > by-pkgid > 693fae8335071ac78e212ca412f4bb45 > files > 9

munin-node-1.4.5-1mdv2010.0.noarch.rpm

#! /bin/sh
#
# munin-node	Control the Munin Node Server (formerly Linpro RRD client)
#
# chkconfig: 345 90 10
# description: munin node agents
# processname: munin-node
# config: /etc/munin/munin-node.conf
# pidfile: /var/run/munin/munin-node.pid

### BEGIN INIT INFO
# Provides: munin-node
# Default-Start: 3 4 5
# Short-Description: A monitoring agent used to graphs various metrics
# Description: A monitoring agent used to graphs various metrics
# Should-Start: $network
### END INIT INFO



# Source function library.
. /etc/rc.d/init.d/functions

NAME=munin-node
BINARY=/usr/sbin/$NAME
PROCESS=$NAME
LOCKFILE=/var/lock/subsys/$NAME

start() {
    # Check if it is already running
    if [ ! -f $LOCKFILE ]; then
	gprintf "Starting %s: " "$NAME"
	daemon $BINARY
	RETVAL=$?
	[ $RETVAL -eq 0 ] && touch $LOCKFILE
	echo
    fi
}

stop() {
    gprintf "Stopping %s:" "$NAME"
    killproc $PROCESS
    RETVAL=$?
    [ $RETVAL -eq 0 ] && rm -f $LOCKFILE
    echo
}

restart() {
    stop
    start
}

RETVAL=0

case "$1" in
    start)
	start
	;;
    stop)
	stop
	;;
    restart|reload)
  	restart
	;;
    status)
	status $PROCESS
	;;
    *)
	gprintf "Usage: %s munin-node {start|stop|status|restart}\n" "$0"
	RETVAL=1
	;;
esac

exit $RETVAL