#! /bin/bash # # collectd Start/Stop the collectd daemon. # # chkconfig: 345 90 60 # description: collectd collects information about the system \ # it is running on and writes this information \ # into special database files. These database \ # files can then be used to generate graphs \ # of the collected data. # processname: collectd # config: /etc/collectd.conf # pidfile: /var/run/collectd/collectd.pid # ### BEGIN INIT INFO # Provides: collectd # Required-Start: $syslog # Required-Stop: $syslog # Default-Start: 2 3 4 5 # Short-Description: Collects system information in RRD files # Description: collectd collects information about the system # it is running on and writes this information # into special database files. These database # files can then be used to generate graphs # of the collected data. ### END INIT INFO # Source function library. . /etc/init.d/functions RETVAL=0 # See how we were called. prog="collectd" start() { gprintf "Starting %s: " "$prog" daemon collectd < /dev/null RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/collectd return $RETVAL } stop() { gprintf "Stopping %s: " "$prog" killproc collectd RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/collectd return $RETVAL } rhstatus() { status collectd } restart() { stop start } reload() { gprintf "Reloading collecting daemon configuration: " killproc collectd -HUP retval=$? echo return $RETVAL } case "$1" in start) start ;; stop) stop ;; restart) restart ;; reload) reload ;; status) rhstatus ;; condrestart) [ -f /var/lock/subsys/collectd ] && restart || : ;; *) gprintf "Usage: %s {start|stop|status|reload|restart|condrestart}\n" "$0" exit 1 esac exit $?