diff options
author | root <root@rshg054.dnsready.net> | 2012-05-26 00:02:35 +0000 |
---|---|---|
committer | root <root@rshg054.dnsready.net> | 2012-05-26 00:02:35 +0000 |
commit | a5721a07196cf00c26ea1bfb651aab756d202ccb (patch) | |
tree | b60f984dd22f98544c8d2fd9526cc24dea3dcd25 /community-staging/collectd/rc.d | |
parent | aa30737839de3c2a4a1287442cb9859414fb4b0a (diff) |
Sat May 26 00:02:35 UTC 2012
Diffstat (limited to 'community-staging/collectd/rc.d')
-rw-r--r-- | community-staging/collectd/rc.d | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/community-staging/collectd/rc.d b/community-staging/collectd/rc.d new file mode 100644 index 000000000..442f2324a --- /dev/null +++ b/community-staging/collectd/rc.d @@ -0,0 +1,39 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions + +name=collectd +prog="/usr/sbin/collectdmon" + +PID=$(pidof -o %PPID $prog) + +case "$1" in +start) + stat_busy "Starting $name daemon" + [[ -z "$PID" ]] && $prog \ + && { add_daemon $name; stat_done; } \ + || { stat_fail; exit 1; } + ;; +stop) + stat_busy "Stopping $name daemon" + [[ -n "$PID" ]] && kill $PID &>/dev/null \ + && { rm_daemon $name; stat_done; } \ + || { stat_fail; exit 1; } + ;; +restart) + $0 stop + sleep 2 + $0 start + ;; +reload) + stat_busy "Sending SIGHUP to $name daemon" + [[ -n "$PID" ]] && kill -HUP $PID &>/dev/null \ + && { stat_done; } \ + || { stat_fail; exit 1; } + ;; +*) + echo "usage: $0 {start|stop|restart|reload}" + exit 1 + ;; +esac |