#!/bin/sh
# $Id: gmond.init,v 1.2 2003/03/07 20:38:30 sacerdoti Exp $
#
# chkconfig: 2345 70 40
# description: gmond startup script
#
### BEGIN INIT INFO
# Provides:          gmond
# Required-Start:    $syslog $remote_fs
# Should-Start: $time ypbind sendmail
# Required-Stop:     $syslog $remote_fs
# Should-Stop: $time ypbind sendmail
# Default-Start:     3 5
# Default-Stop:      0 1 2 6
# Short-Description: Ganglia gmond startup script
# Description:       Ganglia gmond startup script
### END INIT INFO
GMOND=/usr/sbin/gmond

. /etc/rc.status

RETVAL=0
# Reset status of this service
rc_reset

case "$1" in
   start)
      echo -n "Starting GANGLIA gmond"
      [ -f $GMOND ] || exit 1

      startproc $GMOND
	  rc_status -v
	;;

  stop)
      echo -n "Shutting down GANGLIA gmond"
      killproc $GMOND
	  rc_status -v
	;;

  restart)
   	$0 stop
   	$0 start
	;;
  status)
   	checkproc $GMOND
	  rc_status -v
	;;
  *)
	echo "Usage: $0 {start|stop|restart|status}"
	exit 1
esac

exit $RETVAL
