From 26504682bc41d48c6c0872eabbb8138812621d9a Mon Sep 17 00:00:00 2001 From: Colin Patrick McCabe Date: Tue, 15 Feb 2011 09:16:35 -0800 Subject: [PATCH] init-ceph: status: use daemon_is_running daemon_is_running does some nice things like check /proc/$pid/cmdline. Signed-off-by: Colin McCabe --- src/init-ceph.in | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/init-ceph.in b/src/init-ceph.in index 254d42ba1799b..7b972b8658e81 100644 --- a/src/init-ceph.in +++ b/src/init-ceph.in @@ -290,16 +290,10 @@ for name in $what; do ;; status) - if [ -e "$pid_file" ]; then - pid=`cat $pid_file` - if [ -e /proc/$pid ]; then - echo "$pid running..." - else - echo "not running: $pid dead" - EXIT_STATUS=1 - fi + if daemon_is_running $name c$type $id $pid_file; then + echo "running..." else - echo "not running: no pid file" + echo "dead." EXIT_STATUS=1 fi ;; -- 2.39.5