From f0cde44d55c949efc7902268e44a3784ed0a53ec Mon Sep 17 00:00:00 2001 From: Wenzong Fan Date: Tue, 8 Apr 2014 17:07:49 +0800 Subject: collectd: fix init status Fix init status to get it works with 'service --status-all'. Signed-off-by: Wenzong Fan Signed-off-by: Jackie Huang Signed-off-by: Martin Jansa --- meta-oe/recipes-extended/collectd/collectd/collectd.init | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'meta-oe/recipes-extended/collectd') diff --git a/meta-oe/recipes-extended/collectd/collectd/collectd.init b/meta-oe/recipes-extended/collectd/collectd/collectd.init index abdb194a3..95f5f73c6 100644 --- a/meta-oe/recipes-extended/collectd/collectd/collectd.init +++ b/meta-oe/recipes-extended/collectd/collectd/collectd.init @@ -146,6 +146,17 @@ d_stop() { return "$rc" } +# return: +# 0 if the daemon is running +# 3 if the daemon is stopped +d_status(){ + if test "$USE_COLLECTDMON" == 1; then + status $COLLECTDMON_DAEMON + else + status $DAEMON + fi +} + case "$1" in start) echo -n "Starting $NAME" @@ -164,7 +175,7 @@ case "$1" in esac ;; status) - status_of_proc -p "$_PIDFILE" "$DAEMON" "$NAME" && exit 0 || exit $? + d_status ;; restart|force-reload) echo -n "Restarting $NAME" -- cgit v1.2.3-54-g00ecf