[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] cluster/cman/init.d cman



CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL50
Changes by:	cfeist sourceware org	2007-04-27 23:08:40

Modified files:
	cman/init.d    : cman 

Log message:
	Work around network disruption caused by XenD's bridged networking (bz230783, bz231227). (rmmcabe)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/init.d/cman.diff?cvsroot=cluster&only_with_tag=RHEL50&r1=1.26.4.2&r2=1.26.4.3

--- cluster/cman/init.d/cman	2006/11/15 16:55:16	1.26.4.2
+++ cluster/cman/init.d/cman	2007/04/27 22:08:40	1.26.4.3
@@ -132,6 +132,47 @@
     return 0
 }
 
+xend_bridged_net_enabled() {
+    current_runlevel=$(/sbin/runlevel 2>/dev/null | awk '{ print $2 }' 2>/dev/null)
+    if [ -z "$current_runlevel" ]; then
+        errmsg='Unable to determine the current runlevel'
+        return 1
+    fi
+
+    /sbin/chkconfig --levels "$current_runlevel" xend 2>/dev/null
+    if [ $? -ne 0 ]; then
+        # xend doesn't start at this runlevel.
+        return 1
+    fi
+
+    if [ ! -f /etc/xen/xend-config.sxp ]; then
+        # xend isn't configured to use bridged networking.
+        return 1
+    fi
+
+    egrep "^[[:blank:]]*\([[:blank:]]*network-script[[:blank:]]+network-bridge([[:blank:]]*\)|[[:blank:]]+)" /etc/xen/xend-config.sxp 2>/dev/null
+    if [ $? -ne 0 ]; then
+        # xend isn't configured to use bridged networking.
+        return 1
+    fi
+    return 0
+}
+
+xend_bridged_net_start() {
+    if [ ! -x /etc/xen/scripts/network-bridge ]; then
+        if [ -f /etc/xen/scripts/network-bridge ]; then
+            errmsg='The xend bridged network script cannot be run'
+        else
+            errmsg='The xend bridged network script is missing'
+        fi
+        return 1
+    fi
+
+    /sbin/modprobe netbk >& /dev/null
+    /sbin/modprobe netloop >& /dev/null
+    errmsg=$(/etc/xen/scripts/network-bridge start 2>&1) || return 1
+    return 0
+}
 
 fence_xvmd_enabled()
 {
@@ -163,6 +204,20 @@
 start()
 {
     echo "Starting cluster: "
+
+    xend_bridged_net_enabled
+    if [ $? -eq 0 ]
+    then
+        echo -n "   Enabling workaround for Xend bridged networking... "
+        xend_bridged_net_start
+        if [ $? -eq 0 ] 
+        then
+            echo "done"
+        else
+            echo "failed: $errmsg"
+			return 1
+        fi
+    fi
     echo -n "   Loading modules... "
     ulimit -c unlimited
     load_modules


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]