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

Sunil Mushran sunil.mushran at oracle.com
Mon Mar 14 12:31:33 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 |   24 +++++++++++++++++-------
 1 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/vendor/common/o2cb.init.sh b/vendor/common/o2cb.init.sh
index 2b23aa7..6a0d5a2 100644
--- a/vendor/common/o2cb.init.sh
+++ b/vendor/common/o2cb.init.sh
@@ -1458,6 +1458,16 @@ 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 ]
+            echo "Cluster ${CLUSTER} already online"
+            return
+    fi
+
     register_cluster_o2cb "${CLUSTER}"
     if [ $? -eq 1 ]
     then
@@ -1488,6 +1498,13 @@ online_user()
     fi
     CLUSTER="$1"
 
+    check_online $CLUSTER
+    if [ $? = 2 ]
+    then
+        echo "Cluster ${CLUSTER} already online"
+        return
+    fi
+
     load_filesystem "ocfs2"
     if_fail $? "Unable to load ocfs2 driver"
 
@@ -1505,13 +1522,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