[Ocfs2-tools-devel] [PATCH 5/7] o2cb.init: Allow re-online for the o2cb stack in global heartbeat mode

Sunil Mushran sunil.mushran at oracle.com
Thu Mar 17 17:31:49 PDT 2011


Allows users to run "service o2cb online" to register changes to an
already online cluster. This is allowed only for the o2cb stack when
running in the global heartbeat mode.

Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com>
---
 vendor/common/o2cb.init.sh |   26 +++++++++++++++++++-------
 1 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/vendor/common/o2cb.init.sh b/vendor/common/o2cb.init.sh
index fdaab31..fb35de0 100644
--- a/vendor/common/o2cb.init.sh
+++ b/vendor/common/o2cb.init.sh
@@ -1458,6 +1458,18 @@ online_o2cb()
     fi
     CLUSTER="$1"
 
+    # allow re-online if global heartbeat enabled
+    check_online $CLUSTER
+    if [ $? = 2 ]
+    then
+        global_heartbeat_enabled_o2cb
+        if [ $? -ne 1 ]
+        then
+            echo "Cluster ${CLUSTER} already online"
+            return 1
+        fi
+    fi
+
     register_cluster_o2cb "${CLUSTER}"
     if [ $? -eq 1 ]
     then
@@ -1488,6 +1500,13 @@ online_user()
     fi
     CLUSTER="$1"
 
+    check_online $CLUSTER
+    if [ $? = 2 ]
+    then
+        echo "Cluster ${CLUSTER} already online"
+        return 1
+    fi
+
     load_filesystem "ocfs2"
     if_fail $? "Unable to load ocfs2 driver"
 
@@ -1505,13 +1524,6 @@ online()
     fi
     PLUGIN="$(select_stack_plugin)"
 
-    check_online $CLUSTER
-    if [ $? = 2 ]
-    then
-        echo "Cluster ${CLUSTER} already online"
-        return
-    fi
-
     if [ -f "$CLUSTER_STACK_FILE" ]
     then
         echo -n "Setting cluster stack \"$O2CB_STACK\": "
-- 
1.7.1




More information about the Ocfs2-tools-devel mailing list