SOURCES: collectd-init (NEW) - init file for collectd

luzik luzik at pld-linux.org
Mon May 26 09:45:39 CEST 2008


Author: luzik                        Date: Mon May 26 07:45:39 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- init file for collectd

---- Files affected:
SOURCES:
   collectd-init (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/collectd-init
diff -u /dev/null SOURCES/collectd-init:1.1
--- /dev/null	Mon May 26 09:45:39 2008
+++ SOURCES/collectd-init	Mon May 26 09:45:34 2008
@@ -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
+
================================================================


More information about the pld-cvs-commit mailing list