This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cluster: RHEL4 - cman: Start qdiskd before CMAN if qdiskd isconfigured to run


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=6667a111f43a4344996d861e1b0f8e169f163a8c
Commit:        6667a111f43a4344996d861e1b0f8e169f163a8c
Parent:        5a6349be0bdba75d2b1cc90e5c5861d2661a6304
Author:        Lon Hohberger <lhh@redhat.com>
AuthorDate:    Fri Feb 27 17:10:41 2009 -0500
Committer:     Lon Hohberger <lhh@redhat.com>
CommitterDate: Fri Feb 27 17:10:41 2009 -0500

cman: Start qdiskd before CMAN if qdiskd is configured to run

This saves several minutes on startup and can prevent
quorum problems.

Signed-off-by: Lon Hohberger <lhh@redhat.com>
---
 cman/init.d/cman   |   40 ++++++++++++++++++++++++++++++++++++++++
 cman/init.d/qdiskd |   15 ++++++++++++++-
 2 files changed, 54 insertions(+), 1 deletions(-)

diff --git a/cman/init.d/cman b/cman/init.d/cman
index e5e365b..85122ff 100755
--- a/cman/init.d/cman
+++ b/cman/init.d/cman
@@ -39,8 +39,48 @@ in_cluster()
 	grep -q "Cluster Member: Yes" /proc/cluster/status
 }
 
+
+start_qdiskd()
+{
+	declare current_runlevel
+
+	current_runlevel=$(/sbin/runlevel 2>/dev/null | awk '{ print $2 }' 2>/dev/null)
+	#
+	# Start qdiskd before fenced to resolve bug #436381.  This only
+	# happens if qdiskd is configured to run in the runlevel we are in
+	#
+	/sbin/chkconfig --levels "$current_runlevel" qdiskd 2>/dev/null
+	if [ $? -ne 0 ]; then
+		# qdiskd doesn't start at this runlevel.
+		return 0
+	fi
+
+	echo -n "Starting Quorum Disk Daemon:"
+	service qdiskd start &> /dev/null
+	if [ $? -eq 0 ] 
+	then
+		echo_success
+		echo
+	else
+		echo_failure
+		echo
+		return 1
+	fi
+
+	return 0
+}
+
+
 start()
 {
+	# Qdiskd will wait for CMAN to start, but if CMAN
+	# waits for qdiskd to start, it will delay booting by
+	# a very long time.  So, start qdiskd if configured
+	# to do so.  #469103
+	# If qdiskd is not configured for this runlevel, this
+	# operation is a no-op.
+	start_qdiskd
+
 	echo -n "Starting cman:"
 
 	# If gulm is in ccs, don't start cman
diff --git a/cman/init.d/qdiskd b/cman/init.d/qdiskd
index f1c02aa..1ba6940 100755
--- a/cman/init.d/qdiskd
+++ b/cman/init.d/qdiskd
@@ -19,9 +19,22 @@ retries=0
 # See how we were called.
 case "$1" in
   start)
+	status qdiskd >/dev/null
+	if [ $? -eq 0 ]; then
+		exit 0
+	fi
+
 	action "Starting the Quorum Disk Daemon:" qdiskd -Q
 	rtrn=$?
-	[ $rtrn = 0 ] && touch $LOCK_FILE
+	if [ $rtrn = 0 ]; then
+		touch $LOCK_FILE
+		echo_success
+		echo
+	else
+		echo_failure
+		echo
+	fi
+		
 	;;
 
   stop)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]