Blame netdata.init

49b9e7e
#!/bin/bash
49b9e7e
#
49b9e7e
# netdata	This shell script takes care of starting and stopping netdata.
49b9e7e
#
49b9e7e
# chkconfig: 345 99 01
49b9e7e
# description: netdata is a Real-time performance monitoring
49b9e7e
# probe: false
49b9e7e
# processname: netdata
49b9e7e
# pidfile: /var/run/netdata.pid
49b9e7e
### BEGIN INIT INFO
49b9e7e
# Provides: netdata
49b9e7e
# Required-Start: $network
49b9e7e
# Required-Stop: $network
49b9e7e
# Default-Start: 3 4 5
49b9e7e
# Short-Description: netdata.
49b9e7e
# Description: netdata is a highly optimized Linux daemon providing real-time
49b9e7e
# performance monitoring for Linux systems, Applications, SNMP devices, over
49b9e7e
# the web!
49b9e7e
#It tries to visualize the truth of now, in its greatest detail, so that you
49b9e7e
#can get insights of what is happening now and what just happened, on your
49b9e7e
#systems and applications.
49b9e7e
### END INIT INFO
49b9e7e
49b9e7e
49b9e7e
# Source function library.
49b9e7e
. /etc/rc.d/init.d/functions
49b9e7e
49b9e7e
# Source networking configuration.
49b9e7e
. /etc/sysconfig/network
49b9e7e
49b9e7e
[ -f /usr/sbin/netdata ] || exit 0
49b9e7e
49b9e7e
# See how we were called.
49b9e7e
case "$1" in
49b9e7e
	start)
49b9e7e
		if [ -n "`/sbin/pidof netdata`" ]; then
49b9e7e
			echo -n "netdata: already running"
49b9e7e
			RETVAL=$?
49b9e7e
			echo
49b9e7e
			exit $RETVAL
49b9e7e
		fi
49b9e7e
		echo -n "Starting netdata: "
49b9e7e
		/usr/sbin/netdata ${OPTIONS}
49b9e7e
		RETVAL=$?
49b9e7e
		[ $RETVAL -eq 0 ] && success || failure
49b9e7e
		echo
49b9e7e
		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/netdata
49b9e7e
		;;
49b9e7e
	stop)
49b9e7e
		echo -n "Stopping netdata: "
49b9e7e
		killproc netdata
49b9e7e
		RETVAL=$?
49b9e7e
		echo
49b9e7e
		[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/netdata
49b9e7e
		;;
49b9e7e
	status)
49b9e7e
		status netdata
49b9e7e
		RETVAL=$?
49b9e7e
		;;
49b9e7e
	restart|reload)
49b9e7e
		$0 stop
49b9e7e
		$0 start
49b9e7e
		RETVAL=$?
49b9e7e
		;;
49b9e7e
	*)
49b9e7e
		echo "Usage: netdata {start|stop|status|restart}"
49b9e7e
		exit 1
49b9e7e
		;;
49b9e7e
esac
49b9e7e
49b9e7e
exit $RETVAL