aboutsummaryrefslogtreecommitdiff
path: root/system/collectd/rc.collectd
diff options
context:
space:
mode:
authorMatteo Bernardini <ponce@slackbuilds.org>2013-11-08 13:48:36 +0100
committerMatteo Bernardini <ponce@slackbuilds.org>2013-11-08 17:35:12 +0100
commit1b393452df0547e7ca75ff1e3e74484a82e6072e (patch)
tree8724aaa6e9c68d48f8499fc785dd3d4d950937fb /system/collectd/rc.collectd
parenta1fda691eae13d28a10021c3fcab2f7ffd238c38 (diff)
system/collectd: Updated for version 5.4.0.
Added an rc script, fix for gcc-4.8.x, disabled static stuff Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
Diffstat (limited to 'system/collectd/rc.collectd')
-rw-r--r--system/collectd/rc.collectd74
1 files changed, 74 insertions, 0 deletions
diff --git a/system/collectd/rc.collectd b/system/collectd/rc.collectd
new file mode 100644
index 000000000000..23233959292f
--- /dev/null
+++ b/system/collectd/rc.collectd
@@ -0,0 +1,74 @@
+#!/bin/sh
+#
+# rc.d script for collectd
+#
+# Thanks to miklos from slacky.eu
+
+exec=/usr/sbin/collectd
+prog=$(basename $exec)
+configfile=/etc/collectd.conf
+pidfile=/var/run/collectd.pid
+
+start() {
+ [ -x $exec ] || exit 5
+ if [ -f $pidfile ]; then
+ echo "Seems that an active process is up and running with pid $(cat $pidfile)"
+ echo "If this is not true try first to remove pidfile $pidfile"
+ exit 5
+ fi
+ echo $"Starting $prog"
+ $exec -P $pidfile -C $configfile
+}
+
+stop() {
+ if [ -e $pidfile ]; then
+ echo "Stopping $prog"
+ kill -QUIT $(cat $pidfile) 2>/dev/null
+ rm $pidfile
+ fi
+}
+
+status() {
+ echo -n "$prog is "
+ CHECK=$(ps aux | grep $exec | grep -v grep)
+ STATUS=$?
+ if [ "$STATUS" == "1" ]; then
+ echo "not running"
+ else
+ echo "running"
+ fi
+
+}
+
+restart() {
+ stop
+ start
+}
+
+reload() {
+ restart
+}
+
+force_reload() {
+ restart
+}
+
+case "$1" in
+ start)
+ $1
+ ;;
+ stop)
+ $1
+ ;;
+ restart)
+ $1
+ ;;
+ status)
+ $1
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|status|restart}"
+ exit 2
+esac
+exit $?
+