ctdb.init: check availability of ctdb (with ping) before calling ctdb status
authorMichael Adam <obnox@samba.org>
Fri, 12 Dec 2008 15:57:58 +0000 (16:57 +0100)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Mon, 15 Dec 2008 22:51:24 +0000 (09:51 +1100)
Michael

config/ctdb.init

index de3acfb571f8edaca75a5c9763dd6e3e7e8a2995..ddcac762f0285e219f4b90f2fc0d976e632b4f59 100755 (executable)
@@ -199,6 +199,22 @@ restart() {
 }      
 
 status() {
+       echo -n $"Checking for ctdbd service: "
+       ctdb ping >& /dev/null || {
+           RETVAL=$?
+           echo -n "  ctdbd not running. "
+           case $init_style in
+               suse)
+                   set_retval $RETVAL
+                   rc_status -v
+                   ;;
+               redhat)
+                   echo ""
+                   ;;
+           esac
+           return $RETVAL
+       }
+       echo ""
        ctdb status
 }