summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 436d65e)
raw | patch | inline | side by side (parent: 436d65e)
author | Sebastian Harl <sh@tokkee.org> | |
Fri, 1 Feb 2008 20:43:52 +0000 (21:43 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Fri, 1 Feb 2008 20:43:52 +0000 (21:43 +0100) |
This may be configured using the USE_COLLECTDMON variable - enabled by
default.
default.
debian/collectd.default | patch | blob | history | |
debian/collectd.init.d | patch | blob | history |
index d89fd046e305e45652bc68abe3ad5e2ff8b2813e..5ef6a31b9cfd1bd3b5925e413282642ac63774e8 100644 (file)
--- a/debian/collectd.default
+++ b/debian/collectd.default
# default: 0
DISABLE=0
+# 0: start collectd in stand-alone mode, 1: monitor collectd using collectdmon
+# default: 1
+USE_COLLECTDMON=1
+
# number of seconds to wait for collectd to shut down
# default: 30
MAXWAIT=30
diff --git a/debian/collectd.init.d b/debian/collectd.init.d
index 18ece441da3df23de708eaae715b3bf2352f38a1..d7af008760e9f3b30dd426eb77ae5fe6c26922e3 100755 (executable)
--- a/debian/collectd.init.d
+++ b/debian/collectd.init.d
# http://collectd.org/
#
# Copyright (C) 2005-2006 Florian Forster <octo@verplant.org>
-# Copyright (C) 2006-2007 Sebastian Harl <sh@tokkee.org>
+# Copyright (C) 2006-2008 Sebastian Harl <sh@tokkee.org>
#
### BEGIN INIT INFO
CONFIGFILE=/etc/collectd/collectd.conf
PIDFILE=/var/run/collectd.pid
+USE_COLLECTDMON=1
+COLLECTDMON_DAEMON=/usr/sbin/collectdmon
+COLLECTDMON_PIDFILE=/var/run/collectdmon.pid
+
MAXWAIT=30
# Gracefully exit if the package has been removed.
exit 0
fi
+get_pid() {
+ if test "$USE_COLLECTDMON" == 1; then
+ cat "$COLLECTDMON_PIDFILE"
+ else
+ cat "$PIDFILE"
+ fi
+}
+
d_start() {
- start-stop-daemon --start --quiet --pidfile "$PIDFILE" \
- --exec $DAEMON -- -C "$CONFIGFILE" -P "$PIDFILE"
+ if test "$USE_COLLECTDMON" == 1; then
+ start-stop-daemon --start --quiet --pidfile "$COLLECTDMON_PIDFILE" \
+ --exec $COLLECTDMON_DAEMON -- -P "$COLLECTDMON_PIDFILE" -- \
+ -C "$CONFIGFILE"
+ else
+ start-stop-daemon --start --quiet --pidfile "$PIDFILE" \
+ --exec $DAEMON -- -C "$CONFIGFILE" -P "$PIDFILE"
+ fi
}
still_running_warning="
the disk. You can adjust the waiting time in /etc/default/collectd."
d_stop() {
- PID=$( cat "$PIDFILE" 2> /dev/null ) || true
+ PID=$( get_pid 2> /dev/null ) || true
start-stop-daemon --stop --quiet --oknodo --pidfile "$PIDFILE"
}
d_status() {
- PID=$( cat "$PIDFILE" 2> /dev/null ) || true
+ PID=$( get_pid 2> /dev/null ) || true
if test -n "$PID" && kill -0 $PID 2> /dev/null; then
echo "collectd ($PID) is running."