cluster: RHEL63 - cman init: fix handling of lock file

Fabio M. Di Nitto fabbione at fedoraproject.org
Thu Jul 11 08:09:43 UTC 2013


Gitweb:        http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=ec49914de65ac3cad8e11d45a4feddcda227532b
Commit:        ec49914de65ac3cad8e11d45a4feddcda227532b
Parent:        47fe69d5c3048b132dd61ba1637ea7cbdd8cf903
Author:        Fabio M. Di Nitto <fdinitto at redhat.com>
AuthorDate:    Thu Jul 11 09:48:00 2013 +0200
Committer:     Fabio M. Di Nitto <fdinitto at redhat.com>
CommitterDate: Thu Jul 11 10:09:22 2013 +0200

cman init: fix handling of lock file

missing handling of lock file in operations other than start/stop
could lead in a situation where cman was running without
a lock file.

Resolves: rhbz#982699

Original patch by Shane Bradley <sbradley at redhat.com>

Signed-off-by: Fabio M. Di Nitto <fdinitto at redhat.com>

Conflicts:

	cman/init.d/cman.in
---
 cman/init.d/cman.in |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/cman/init.d/cman.in b/cman/init.d/cman.in
index 9a0d726..a7db1b3 100644
--- a/cman/init.d/cman.in
+++ b/cman/init.d/cman.in
@@ -743,13 +743,13 @@ start()
 		none \
 		"Mounting configfs"
 
-	[ "$breakpoint" = "setup" ] && exit 0
+	[ "$breakpoint" = "setup" ] && return 0
 
 	runwrap start_cman \
 		none \
 		"Starting cman"
 
-	[ "$breakpoint" = "join" ] && exit 0
+	[ "$breakpoint" = "join" ] && return 0
 
 	runwrap start_qdiskd \
 		qdiskd_enabled \
@@ -759,7 +759,7 @@ start()
 		none \
 		"Waiting for quorum"
 
-	[ "$breakpoint" = "quorum" ] && exit 0
+	[ "$breakpoint" = "quorum" ] && return 0
 
 	runwrap start_groupd \
 		groupd_enabled \
@@ -785,7 +785,7 @@ start()
 		cmannotifyd_enabled \
 		"Starting cmannotifyd"
 
-	[ "$breakpoint" = "daemons" ] && exit 0
+	[ "$breakpoint" = "daemons" ] && return 0
 
 	runwrap unfence_self \
 		none \
@@ -913,14 +913,14 @@ stop)
 ;;
 restart|reload|force-reload)
 	cmanremove=remove
-	stop
-	start
+	stop && rm -f $LOCK_FILE
+	start && touch $LOCK_FILE
 ;;
 condrestart|try-restart)
 	if cmanstatus; then
 		cmanremove=remove
-		stop
-		start
+		stop && rm -f $LOCK_FILE
+		start && touch $LOCK_FILE
 	fi
 ;;
 status)


More information about the cluster-commits mailing list