From: Colin Patrick McCabe Date: Tue, 15 Feb 2011 17:16:35 +0000 (-0800) Subject: init-ceph: status: use daemon_is_running X-Git-Tag: v0.25~118 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=26504682bc41d48c6c0872eabbb8138812621d9a;p=ceph.git init-ceph: status: use daemon_is_running daemon_is_running does some nice things like check /proc/$pid/cmdline. Signed-off-by: Colin McCabe --- diff --git a/src/init-ceph.in b/src/init-ceph.in index 254d42ba179..7b972b8658e 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 ;;