[Ocfs2-tools-commits] jlbec commits r1088 - trunk/vendor/common

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Thu Sep 22 19:18:44 CDT 2005


Author: jlbec
Date: 2005-09-22 19:18:44 -0500 (Thu, 22 Sep 2005)
New Revision: 1088

Modified:
   trunk/vendor/common/o2cb.init
Log:

o Teach o2cb.init to find the new location of heartbeat's
  dead_threshold.


Modified: trunk/vendor/common/o2cb.init
===================================================================
--- trunk/vendor/common/o2cb.init	2005-09-22 22:35:58 UTC (rev 1087)
+++ trunk/vendor/common/o2cb.init	2005-09-23 00:18:44 UTC (rev 1088)
@@ -263,8 +263,11 @@
     then
         ls -1 "/config/cluster/${CLUSTER}/heartbeat/" | while read HBUUID
         do
-            return 2;
-        done;
+            if [ -d "/config/cluster/${CLUSTER}/heartbeat/${HBUUID}" ]
+            then
+                return 2;
+            fi
+        done
         if [ $? = 2 ]
         then
             RC=2
@@ -297,6 +300,11 @@
 
     ls -1 "/config/cluster/${CLUSTER}/heartbeat/" | while read HBUUID
     do
+        if [ ! -d "/config/cluster/${CLUSTER}/heartbeat/${HBUUID}" ]
+        then
+            continue
+        fi
+
         OUTPUT="`ocfs2_hb_ctl -I -u ${HBUUID} 2>&1`"
         if [ $? != 0 ]
         then
@@ -309,7 +317,7 @@
         if [ $REF != 0 ]
         then
            echo "Failed"
-           echo "Atleast one heartbeat region still active" >&2
+           echo "At least one heartbeat region still active" >&2
            exit 1
         else
            OUTPUT="`ocfs2_hb_ctl -K -u ${HBUUID} 2>&1`"
@@ -483,9 +491,6 @@
         eval ${LOAD_ACTIONS[i]}
         if_fail "$?"
     done
-    if [ -n "$O2CB_HEARTBEAT_THRESHOLD" ]; then
-        echo "$O2CB_HEARTBEAT_THRESHOLD" > /proc/fs/ocfs2_nodemanager/hb_dead_threshold
-    fi
 }
 
 load_status()
@@ -516,6 +521,18 @@
     OUTPUT="`o2cb_ctl -H -n "${CLUSTER}" -t cluster -a online=yes 2>&1`"
     if [ $? = 0 ]
     then
+        O2CB_HEARTBEAT_THRESHOLD_FILE_OLD=/proc/fs/ocfs2_nodemanager/hb_dead_threshold
+        O2CB_HEARTBEAT_THRESHOLD_FILE=/config/cluster/${CLUSTER}/heartbeat/dead_threshold
+        if [ -n "$O2CB_HEARTBEAT_THRESHOLD" ]; then
+            if [ -f "$O2CB_HEARTBEAT_THRESHOLD_FILE" ]; then
+                echo "$O2CB_HEARTBEAT_THRESHOLD" > "$O2CB_HEARTBEAT_THRESHOLD_FILE"
+            elif [ -f "$O2CB_HEARTBEAT_THRESHOLD_FILE_OLD" ]; then 
+                echo "$O2CB_HEARTBEAT_THRESHOLD" > "$O2CB_HEARTBEAT_THRESHOLD_FILE_OLD"
+            else
+                echo "WARNING: Unable to set heartbeat dead threshold" >&2
+            fi
+        fi
+
         echo "OK"
         return
     else



More information about the Ocfs2-tools-commits mailing list