summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8a203e6)
raw | patch | inline | side by side (parent: 8a203e6)
author | Sebastian Harl <sh@tokkee.org> | |
Sun, 6 Jan 2008 17:12:17 +0000 (18:12 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sun, 6 Jan 2008 17:12:17 +0000 (18:12 +0100) |
debian/collectd.init.d | patch | blob | history |
diff --git a/debian/collectd.init.d b/debian/collectd.init.d
index 42a90cd6047795ed2f2d4f5e2cea2146f621ed39..18ece441da3df23de708eaae715b3bf2352f38a1 100755 (executable)
--- a/debian/collectd.init.d
+++ b/debian/collectd.init.d
fi
}
+d_status() {
+ PID=$( cat "$PIDFILE" 2> /dev/null ) || true
+
+ if test -n "$PID" && kill -0 $PID 2> /dev/null; then
+ echo "collectd ($PID) is running."
+ exit 0
+ else
+ PID=$( pidof collectd ) || true
+
+ if test -n "$PID"; then
+ echo "collectd ($PID) is running."
+ exit 0
+ else
+ echo "collectd is stopped."
+ fi
+ fi
+}
+
case "$1" in
start)
echo -n "Starting $DESC: $NAME"
d_stop
echo "."
;;
+ status)
+ d_status
+ ;;
restart|force-reload)
echo -n "Restarting $DESC: $NAME"
d_stop