From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31417 invoked by alias); 27 Aug 2008 16:02:33 -0000 Received: (qmail 31411 invoked by alias); 27 Aug 2008 16:02:33 -0000 X-Spam-Status: No, hits=-1.0 required=5.0 tests=AWL,BAYES_05,KAM_MX,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on bastion.fedora.phx.redhat.com X-Spam-Level: Subject: RHEL5 - init.d/cman: use fence_tool -m for two node clusters To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/RHEL5 X-Git-Reftype: branch X-Git-Oldrev: 5ea416d26ec2b6bf605c573a5173736d0f8cd27c X-Git-Newrev: 397b8111d2d69b9dd25e7b074822be571f274032 From: David Teigland Message-Id: <20080827160133.3108312036B@lists.fedorahosted.org> Date: Wed, 27 Aug 2008 16:40: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: 2008-q3/txt/msg00332.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=397b8111d2d69b9dd25e7b074822be571f274032 Commit: 397b8111d2d69b9dd25e7b074822be571f274032 Parent: 5ea416d26ec2b6bf605c573a5173736d0f8cd27c Author: David Teigland AuthorDate: Tue Aug 26 16:28:20 2008 -0500 Committer: David Teigland CommitterDate: Wed Aug 27 10:51:44 2008 -0500 init.d/cman: use fence_tool -m for two node clusters bz 460190 Use the new fence_tool -m option in the cman init script for two node clusters. This delays fence_tool join when both nodes aren't members. The delay allows initial cluster partitions (due to badly configured network/switches) to converge before starting fencing. Signed-off-by: David Teigland --- cman/init.d/cman | 16 ++++++++++++++-- 1 files changed, 14 insertions(+), 2 deletions(-) diff --git a/cman/init.d/cman b/cman/init.d/cman index 9a28a11..4156b98 100755 --- a/cman/init.d/cman +++ b/cman/init.d/cman @@ -38,6 +38,10 @@ # wait indefinately for fenced to start. [ -z "$FENCED_START_TIMEOUT" ] && FENCED_START_TIMEOUT=300 +# FENCED_MEMBER_DELAY -- amount of time to delay fence_tool join to allow +# all nodes in cluster.conf to become cluster members. In seconds. +[ -z "$FENCED_MEMBER_DELAY" ] && FENCED_MEMBER_DELAY=45 + # FENCE_JOIN -- boolean value used to control whether or not this node # should join the fence domain. If FENCE_JOIN is set to "no", then # the script will not attempt to the fence domain. If FENCE_JOIN is @@ -156,8 +160,16 @@ start_daemons() start_fence() { - errmsg=$( /sbin/fence_tool -w -t $FENCED_START_TIMEOUT join \ - > /dev/null 2>&1 ) || return 1 + /usr/sbin/cman_tool status | grep Flags | grep 2node &> /dev/null + if [ $? -ne 0 ] + then + errmsg=$( /sbin/fence_tool -w -t $FENCED_START_TIMEOUT join \ + > /dev/null 2>&1 ) || return 1 + else + errmsg=$( /sbin/fence_tool -w -t $FENCED_START_TIMEOUT \ + -m $FENCED_MEMBER_DELAY join \ + > /dev/null 2>&1 ) || return 1 + fi return 0 }