]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
init-ceph: status: use daemon_is_running
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Tue, 15 Feb 2011 17:16:35 +0000 (09:16 -0800)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Tue, 15 Feb 2011 17:16:35 +0000 (09:16 -0800)
daemon_is_running does some nice things like check /proc/$pid/cmdline.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
src/init-ceph.in

index 254d42ba1799b37f71bb9806346de822d63a419e..7b972b8658e81143e7222266663d55291e9b42f2 100644 (file)
@@ -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
            ;;