public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
From: "Fabio M. Di Nitto" <fabbione@fedoraproject.org>
To: cluster-cvs-relay@redhat.com
Subject: cluster: STABLE3 - cman init: add cman_running local function
Date: Fri, 27 Mar 2009 19:07:00 -0000	[thread overview]
Message-ID: <20090327190633.6D62D12020C@lists.fedorahosted.org> (raw)

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=4c237dd55d272ee11ba97ffd9a730a3d83ff6069
Commit:        4c237dd55d272ee11ba97ffd9a730a3d83ff6069
Parent:        baa58122d5fb7957c2955cb39ed32613a9edb664
Author:        Fabio M. Di Nitto <fdinitto@redhat.com>
AuthorDate:    Wed Mar 25 15:25:48 2009 +0100
Committer:     Fabio M. Di Nitto <fdinitto@redhat.com>
CommitterDate: Fri Mar 27 20:05:46 2009 +0100

cman init: add cman_running local function

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
---
 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


                 reply	other threads:[~2009-03-27 19:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090327190633.6D62D12020C@lists.fedorahosted.org \
    --to=fabbione@fedoraproject.org \
    --cc=cluster-cvs-relay@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).