public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* cluster: master - fence_tool, init.d/cman: fix wait/retry options
@ 2009-03-17 19:26 David Teigland
  0 siblings, 0 replies; only message in thread
From: David Teigland @ 2009-03-17 19:26 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=b0d82b0f0a3bf06189e6664d273f885a971c3817
Commit:        b0d82b0f0a3bf06189e6664d273f885a971c3817
Parent:        c3bd2524e7a5de95a14cd961116764bb8621c4bf
Author:        David Teigland <teigland@redhat.com>
AuthorDate:    Tue Mar 17 14:21:58 2009 -0500
Committer:     David Teigland <teigland@redhat.com>
CommitterDate: Tue Mar 17 14:21:58 2009 -0500

fence_tool, init.d/cman: fix wait/retry options

Bring some sanity to the fence_tool ad hoc wait/retry options, which
are used by init.d/cman.  At a high level we want:
. fence_tool join to fail right away, with an error, if cman or
  fenced fail or aren't running
. fence_tool join to exit with 0 if the join succeeds and
  with 1 if it fails
. do these things properly even when fenced is slow starting up,
  or in processing the join

Signed-off-by: David Teigland <teigland@redhat.com>
---
 cman/init.d/cman.in |   20 +++++++++-----------
 1 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/cman/init.d/cman.in b/cman/init.d/cman.in
index cf3550e..8b4c26a 100644
--- a/cman/init.d/cman.in
+++ b/cman/init.d/cman.in
@@ -92,12 +92,11 @@ fi
 #                         are found in @NOTIFYDDIR@
 [ -z "$CMAN_NOTIFYD_START" ] && CMAN_NOTIFYD_START=conditional
 
-# FENCED_START_TIMEOUT -- amount of time to wait for starting fenced
-#     before giving up.  If FENCED_START_TIMEOUT is positive, then we will
-#     wait FENCED_START_TIMEOUT seconds before giving up and failing when
-#     fenced does not start.  If FENCED_START_TIMEOUT is zero, then
-#     wait indefinately for fenced to start.
-[ -z "$FENCED_START_TIMEOUT" ] && FENCED_START_TIMEOUT=300
+# FENCE_JOIN_TIMEOUT -- seconds to wait for fence domain join to
+#     complete.  If the join hasn't completed in this time, fence_tool join
+#     exits with an error, and this script exits with an error.  To wait
+#     indefinitely set the value to -1.
+[ -z "$FENCE_JOIN_TIMEOUT" ] && FENCE_JOIN_TIMEOUT=20
 
 # NET_RMEM_DEFAULT -- minimum value for rmem_default. If this is set
 # higher elsewhere it will not be reduced here.
@@ -294,11 +293,11 @@ start_fence()
     @SBINDIR@/cman_tool status | grep Flags | grep 2node > /dev/null 2>&1
     if [ $? -ne 0 ]
     then
-        errmsg=$( @SBINDIR@/fence_tool -w -t $FENCED_START_TIMEOUT join \
+        errmsg=$( @SBINDIR@/fence_tool join -w $FENCE_JOIN_TIMEOUT \
                  > /dev/null 2>&1 ) || return 1
     else
-        errmsg=$( @SBINDIR@/fence_tool -w -t $FENCED_START_TIMEOUT \
-                 -m $FENCED_MEMBER_DELAY join \
+        errmsg=$( @SBINDIR@/fence_tool join -w $FENCE_JOIN_TIMEOUT \
+		 -m $FENCED_MEMBER_DELAY join \
                  > /dev/null 2>&1 ) || return 1
     fi
     return 0
@@ -582,9 +581,8 @@ stop_fence()
 {
     if pidof fenced > /dev/null 2>&1
     then
-	@SBINDIR@/fence_tool -w leave > /dev/null 2>&1
+	@SBINDIR@/fence_tool leave -w 10 > /dev/null 2>&1
 	rtrn=$?
-	sleep 1 # A bit of time for fenced to exit
 	return $rtrn
     fi
     return 0 # all ok


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-03-17 19:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-17 19:26 cluster: master - fence_tool, init.d/cman: fix wait/retry options David Teigland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).