cluster: STABLE3 - cman init: don't start cluster if NM is running or about to run

Fabio M. Di Nitto fabbione at fedoraproject.org
Tue Dec 8 14:23:47 UTC 2009


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=a5a00460b26078a036e2c1fc38246877076cfae6
Commit:        a5a00460b26078a036e2c1fc38246877076cfae6
Parent:        c467ebb3cc1556e95bf4084b55ef613cb7972f79
Author:        Fabio M. Di Nitto <fdinitto at redhat.com>
AuthorDate:    Tue Dec 8 15:22:30 2009 +0100
Committer:     Fabio M. Di Nitto <fdinitto at redhat.com>
CommitterDate: Tue Dec 8 15:22:30 2009 +0100

cman init: don't start cluster if NM is running or about to run

Too many problems to run cluster and Network Manager together.

>From now on this is unsupported setup.

Signed-off-by: Fabio M. Di Nitto <fdinitto at redhat.com>
---
 cman/init.d/cman.in |   29 ++++++++++++++++++++++++++---
 1 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/cman/init.d/cman.in b/cman/init.d/cman.in
index 68fafd6..d391a77 100644
--- a/cman/init.d/cman.in
+++ b/cman/init.d/cman.in
@@ -21,7 +21,16 @@ PATH="/bin:/usr/bin:/sbin:/usr/sbin:@SBINDIR@"
 
 local_chkconfig()
 {
-	ls /etc/rc${2}.d/S*${3} > /dev/null 2>/dev/null
+	case "$1" in
+	--levels)
+		ls /etc/rc${2}.d/S*${3} > /dev/null 2>/dev/null
+		return $?
+	;;
+	*)
+		ls /etc/rc*.d/S*${1} > /dev/null 2>/dev/null
+		return $?
+	;;
+	esac
 }
 
 success()
@@ -175,7 +184,7 @@ ok() {
 }
 
 nok() {
-	echo "$errmsg"
+	echo -e "$errmsg"
 	failure
 	echo
 	exit 1
@@ -267,6 +276,16 @@ sshd_enabled()
 	return 1
 }
 
+network_manager_enabled()
+{
+	if status NetworkManager > /dev/null 2>&1 || \
+	   chkconfig NetworkManager; then
+		errmsg="\nNetwork Manager is either running or configured to run. Please disable it in the cluster."
+		return 1
+	fi
+	return 0
+}
+
 mtab_configfs()
 {
 	awk '{ print $2 }' /etc/mtab | \
@@ -684,6 +703,10 @@ start()
 
 	echo $echoarg "Starting cluster: "
 
+	runwrap network_manager_enabled \
+		none \
+		"Checking Network Manager"
+
 	runwrap start_fence_xvmd \
 		fence_xvmd_standalone \
 		"Starting virtual machine fencing host (standalone)"
@@ -898,7 +921,7 @@ status)
 			echo "cluster is running."
 		fi
 	else
-		echo "$errmsg"
+		echo -e "$errmsg"
 	fi
 ;;
 *)


More information about the cluster-commits mailing list