From: luzik Date: Mon, 26 May 2008 07:45:34 +0000 (+0000) Subject: - init file for collectd X-Git-Tag: auto/th/collectd-4_5_0-1~19 X-Git-Url: http://git.pld-linux.org/?p=packages%2Fcollectd.git;a=commitdiff_plain;h=db900f383adb7373b8498f197c04e2c1be27cc7a;hp=5fafedfc0291e740d6622c18912c69df3978b0fc - init file for collectd Changed files: collectd.init -> 1.1 --- diff --git a/collectd.init b/collectd.init new file mode 100644 index 0000000..d2c89a9 --- /dev/null +++ b/collectd.init @@ -0,0 +1,58 @@ +#!/bin/sh +# +# collectd collectd (collectd daemon) +# +# chkconfig: 345 93 11 +# +# description: utility that colect various system information \ +# into rrd files \ + + + +# Source function library +. /etc/rc.d/init.d/functions + +# Get service config +[ -f /etc/sysconfig/collectd ] && . /etc/sysconfig/collectd + + + +RETVAL=0 + +case "$1" in + start) + # Check if the service is already running? + if [ ! -f /var/lock/subsys/collectd ]; then + msg_starting collectd + daemon /usr/sbin/collectd + RETVAL=$? + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/collectd + else + msg_already_running collectd + fi + ;; + stop) + if [ -f /var/lock/subsys/collectd ]; then + msg_stopping collectd + killproc collectd + rm -f /var/lock/subsys/collectd >/dev/null 2>&1 + else + msg_not_running collectd + fi + ;; + restart) + $0 stop + $0 start + exit $? + ;; + status) + status collectd + exit $? + ;; + *) + msg_usage "$0 {start|stop|restart|status}" + exit 3 +esac + +exit $RETVAL +