Gitweb:
http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=c77921e6dd8...
Commit: c77921e6dd8186ffc80b9e3422f3b098d0b778a2
Parent: 82cd95a1c87267e9f7db0a4f9865efb0344e26e1
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Thu Jul 11 09:48:00 2013 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Thu Jul 11 09:48:00 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#982670
Original patch by Shane Bradley <sbradley(a)redhat.com>
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/init.d/cman.in | 19 +++++++++----------
1 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/cman/init.d/cman.in b/cman/init.d/cman.in
index 728b42d..eb3c2d1 100644
--- a/cman/init.d/cman.in
+++ b/cman/init.d/cman.in
@@ -799,7 +799,6 @@ tune_dlm_config()
return 0
}
-
start()
{
@@ -839,19 +838,19 @@ 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_cmannotifyd \
cmannotifyd_enabled \
"Starting cmannotifyd"
- [ "$breakpoint" = "notify" ] && exit 0
+ [ "$breakpoint" = "notify" ] && return 0
runwrap start_qdiskd \
qdiskd_enabled \
@@ -861,7 +860,7 @@ start()
none \
"Waiting for quorum"
- [ "$breakpoint" = "quorum" ] && exit 0
+ [ "$breakpoint" = "quorum" ] && return 0
runwrap start_groupd \
groupd_enabled \
@@ -885,7 +884,7 @@ start()
ocfs2_enabled \
"Starting ocfs2_controld"
- [ "$breakpoint" = "daemons" ] && exit 0
+ [ "$breakpoint" = "daemons" ] && return 0
fence_sanlock_check
@@ -1011,14 +1010,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)