From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4012 invoked by alias); 27 Mar 2009 19:07:04 -0000 Received: (qmail 3867 invoked by alias); 27 Mar 2009 19:07:03 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Status: No, hits=-1.8 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 bastion.fedora.phx.redhat.com Subject: cluster: STABLE3 - cman init: add cman_running local function 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: baa58122d5fb7957c2955cb39ed32613a9edb664 X-Git-Newrev: 4c237dd55d272ee11ba97ffd9a730a3d83ff6069 From: "Fabio M. Di Nitto" Message-Id: <20090327190633.6D62D12020C@lists.fedorahosted.org> Date: Fri, 27 Mar 2009 19:07: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-q1/txt/msg00952.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=4c237dd55d272ee11ba97ffd9a730a3d83ff6069 Commit: 4c237dd55d272ee11ba97ffd9a730a3d83ff6069 Parent: baa58122d5fb7957c2955cb39ed32613a9edb664 Author: Fabio M. Di Nitto AuthorDate: Wed Mar 25 15:25:48 2009 +0100 Committer: Fabio M. Di Nitto CommitterDate: Fri Mar 27 20:05:46 2009 +0100 cman init: add cman_running local function Signed-off-by: Fabio M. Di Nitto --- cman/init.d/cman.in | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/cman/init.d/cman.in b/cman/init.d/cman.in index 8cc224c..801ed19 100644 --- a/cman/init.d/cman.in +++ b/cman/init.d/cman.in @@ -179,6 +179,12 @@ xend_bridged_net_enabled() { return 0 } +cman_running() +{ + @SBINDIR@/cman_tool status > /dev/null 2>&1 + return $? +} + fence_join_enabled() { # @@ -209,7 +215,7 @@ fence_xvmd_enabled() # (If -X is specified, it doesn't matter if it's in cluster.conf; # we'll start it anyway since ccsd is not required) # - if @SBINDIR@/cman_tool status > /dev/null 2>&1; then + if cman_running; then if [ "$FENCE_XVMD_OPTS" = "${FENCE_XVMD_OPTS/-X/}" ]; then @SBINDIR@/ccs_tool query /cluster/fence_xvmd || return 1 fi @@ -262,6 +268,8 @@ cmannotifyd_enabled() esac } +### the real stuff starts here + load_modules() { errmsg=$( /sbin/modprobe configfs 2>&1 ) || return 1 @@ -282,7 +290,7 @@ start_configfs() start_cman() { # cman - if ! @SBINDIR@/cman_tool status > /dev/null 2>&1; then + if ! cman_running; then case "$CONFIG_LOADER" in ldapconfig) if [ -n "$LDAP_URL" ] || [ -n "$LDAP_BASEDN" ]; then @@ -531,7 +539,7 @@ stop_configfs() stop_cman() { - if @SBINDIR@/cman_tool status > /dev/null 2>&1; then + if cman_running; then errmsg=$( @SBINDIR@/cman_tool -t $CMAN_SHUTDOWN_TIMEOUT \ -w leave $1 2>&1 ) || return 1 fi