From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32405 invoked by alias); 20 Aug 2009 07:35:45 -0000 Received: (qmail 32399 invoked by alias); 20 Aug 2009 07:35:45 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Status: No, hits=-1.9 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 init: fix cman startup issues 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: cd7204afe474d03067e18f7d6786410893620e07 X-Git-Newrev: 6c4b0ee0886d6105fe8e5ead2db4e192cbc9e20e From: "Fabio M. Di Nitto" Message-Id: <20090820073520.7E4A712036A@lists.fedorahosted.org> Date: Thu, 20 Aug 2009 07:35:00 -0000 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 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/msg00224.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=6c4b0ee0886d6105fe8e5ead2db4e192cbc9e20e Commit: 6c4b0ee0886d6105fe8e5ead2db4e192cbc9e20e Parent: cd7204afe474d03067e18f7d6786410893620e07 Author: Fabio M. Di Nitto AuthorDate: Thu Aug 20 09:31:53 2009 +0200 Committer: Fabio M. Di Nitto CommitterDate: Thu Aug 20 09:31:53 2009 +0200 cman init: fix cman startup issues with recent changes to cman/corosync to better report errors on startup, we accidentally fixed "too much" logging with debug="on". those changes introduced a bunch of problems with file descriptors in the init script. change the init script to startup cman in such a way that it won't make a mess of fd's. Signed-off-by: Fabio M. Di Nitto --- cman/init.d/cman.in | 30 +++++++++++++++++++++++++----- 1 files changed, 25 insertions(+), 5 deletions(-) diff --git a/cman/init.d/cman.in b/cman/init.d/cman.in index e753f7c..050bfe7 100644 --- a/cman/init.d/cman.in +++ b/cman/init.d/cman.in @@ -169,7 +169,7 @@ ok() { } nok() { - echo $errmsg + echo "$errmsg" failure echo exit 1 @@ -479,10 +479,30 @@ set_networking_params() start_cman() { - if ! cman_running && cman_checkconfig; then - errmsg=$( cman_tool -t $CMAN_CLUSTER_TIMEOUT -w join \ - $cman_join_opts 2>&1 ) || return 1 + cman_running && return 0 + cman_checkconfig || return 1 + + tmpfile=$(mktemp -t cmanstartup.XXXXXXXXXX) + if [ -z "$tmpfile" ]; then + errmsg="Unable to create temporary file" + return 1 + fi + + cman_tool -t $CMAN_CLUSTER_TIMEOUT -w join $cman_join_opts > $tmpfile 2>&1 & + + while status cman_tool >/dev/null 2>&1; do + sleep 0.2 + done + + if ! cman_running; then + errmsg="$(cat $tmpfile)" + ret=1 + else + ret=0 fi + + rm -f $tmpfile + return $ret } wait_for_quorum() @@ -840,7 +860,7 @@ status) echo "cluster is running." fi else - echo $errmsg + echo "$errmsg" rtrn=1 fi ;;