summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f40ca42)
raw | patch | inline | side by side (parent: f40ca42)
author | Sebastian Harl <sh@tokkee.org> | |
Tue, 5 Feb 2008 22:14:13 +0000 (23:14 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Tue, 5 Feb 2008 22:14:13 +0000 (23:14 +0100) |
Slightly simplified the handling of different setups.
debian/collectd.init.d | patch | blob | history |
diff --git a/debian/collectd.init.d b/debian/collectd.init.d
index de14e3508773faefdc4bbe1181030feecb2a1571..0fa14d8dbb3b7713d045702ecf5337807c4775d8 100755 (executable)
--- a/debian/collectd.init.d
+++ b/debian/collectd.init.d
exit 0
fi
-get_pid() {
- if test "$USE_COLLECTDMON" == 1; then
- cat "$COLLECTDMON_PIDFILE"
- else
- cat "$PIDFILE"
- fi
-}
+if test "$USE_COLLECTDMON" == 1; then
+ _PIDFILE="$COLLECTDMON_PIDFILE"
+else
+ _PIDFILE="$PIDFILE"
+fi
d_start() {
if test "$USE_COLLECTDMON" == 1; then
- start-stop-daemon --start --quiet --pidfile "$COLLECTDMON_PIDFILE" \
- --exec $COLLECTDMON_DAEMON -- -P "$COLLECTDMON_PIDFILE" -- \
- -C "$CONFIGFILE"
+ start-stop-daemon --start --quiet --pidfile "$_PIDFILE" \
+ --exec $COLLECTDMON_DAEMON -- -P "$_PIDFILE" -- -C "$CONFIGFILE"
else
- start-stop-daemon --start --quiet --pidfile "$PIDFILE" \
- --exec $DAEMON -- -C "$CONFIGFILE" -P "$PIDFILE"
+ start-stop-daemon --start --quiet --pidfile "$_PIDFILE" \
+ --exec $DAEMON -- -C "$CONFIGFILE" -P "$_PIDFILE"
fi
}
the disk. You can adjust the waiting time in /etc/default/collectd."
d_stop() {
- PID=$( get_pid 2> /dev/null ) || true
+ PID=$( cat "$_PIDFILE" 2> /dev/null ) || true
- start-stop-daemon --stop --quiet --oknodo --pidfile "$PIDFILE"
+ start-stop-daemon --stop --quiet --oknodo --pidfile "$_PIDFILE"
sleep 1
if test -n "$PID" && kill -0 $PID 2> /dev/null; then
}
d_status() {
- PID=$( get_pid 2> /dev/null ) || true
+ PID=$( cat "$_PIDFILE" 2> /dev/null ) || true
if test -n "$PID" && kill -0 $PID 2> /dev/null; then
echo "collectd ($PID) is running."