From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20217 invoked by alias); 6 Aug 2009 16:58:58 -0000 Received: (qmail 20210 invoked by alias); 6 Aug 2009 16:58:58 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bastion2.fedora.phx.redhat.com Subject: cluster: STABLE3 - cman: wait for quorum To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/STABLE3 X-Git-Reftype: branch X-Git-Oldrev: a0b7e5fc2d35021b5617cece6b959859efdfaba6 X-Git-Newrev: 1bfe888048a09b324e7dd65b5d6c125530409327 From: David Teigland Message-Id: <20090806165837.94F7512019B@lists.fedorahosted.org> Date: Thu, 06 Aug 2009 16:58:00 -0000 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2009-q3/txt/msg00161.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=1bfe888048a09b324e7dd65b5d6c125530409327 Commit: 1bfe888048a09b324e7dd65b5d6c125530409327 Parent: a0b7e5fc2d35021b5617cece6b959859efdfaba6 Author: David Teigland AuthorDate: Thu Aug 6 11:13:57 2009 -0500 Committer: David Teigland CommitterDate: Thu Aug 6 11:13:57 2009 -0500 cman: wait for quorum Wait for quorum when starting. https://www.redhat.com/archives/cluster-devel/2009-August/msg00006.html Signed-off-by: David Teigland --- cman/init.d/cman.in | 18 +++++++++++++++--- 1 files changed, 15 insertions(+), 3 deletions(-) diff --git a/cman/init.d/cman.in b/cman/init.d/cman.in index 6481d6b..ff140fc 100644 --- a/cman/init.d/cman.in +++ b/cman/init.d/cman.in @@ -68,13 +68,13 @@ fi # a cluster is not joined. If CMAN_CLUSTER_TIMEOUT is zero, then # wait indefinately for a cluster join. If CMAN_CLUSTER_TIMEOUT is # negative, do not check to see that the cluster has been joined -[ -z "$CMAN_CLUSTER_TIMEOUT" ] && CMAN_CLUSTER_TIMEOUT=120 +[ -z "$CMAN_CLUSTER_TIMEOUT" ] && CMAN_CLUSTER_TIMEOUT=60 # CMAN_QUORUM_TIMEOUT -- amount of time to wait for a quorate cluster on # startup quorum is needed by many other applications, so we may as -# well wait here. If CMAN_QUORUM_TIMEOUT is less than 1, quorum will +# well wait here. If CMAN_QUORUM_TIMEOUT is zero, quorum will # be ignored. -[ -z "$CMAN_QUORUM_TIMEOUT" ] && CMAN_QUORUM_TIMEOUT=0 +[ -z "$CMAN_QUORUM_TIMEOUT" ] && CMAN_QUORUM_TIMEOUT=20 # CMAN_SHUTDOWN_TIMEOUT -- amount of time to wait for cman to become a # cluster member before calling cman_tool leave during shutdown. @@ -490,6 +490,14 @@ start_cman() fi } +wait_for_quorum() +{ + if [ $CMAN_QUORUM_TIMEOUT -gt 0 ]; then + errmsg=$( cman_tool -t $CMAN_QUORUM_TIMEOUT \ + -q wait 2>&1 ) || return 1 + fi +} + stop_cman() { if cman_running; then @@ -678,6 +686,10 @@ start() qdiskd_enabled \ "Starting qdiskd" + runwrap wait_for_quorum \ + none \ + "Waiting for quorum" + runwrap start_groupd \ groupd_enabled \ "Starting groupd"