collectd: fix init status

Fix init status to get it works with 'service --status-all'.

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
This commit is contained in:
Wenzong Fan
2014-04-08 17:07:49 +08:00
committed by Martin Jansa
parent 438d363331
commit f0cde44d55
@@ -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"