This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cluster: STABLE3 - cman init: add support for join and leave options


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=b11739b572d52d03e6ddddea07e62600fcf191c5
Commit:        b11739b572d52d03e6ddddea07e62600fcf191c5
Parent:        6c4dea2b599fc9f461a7e1063f36a772c8e7d15f
Author:        Fabio M. Di Nitto <fdinitto@redhat.com>
AuthorDate:    Fri May 15 08:05:36 2009 +0200
Committer:     Fabio M. Di Nitto <fdinitto@redhat.com>
CommitterDate: Fri May 15 08:05:36 2009 +0200

cman init: add support for join and leave options

Some users might require special cman_tool options on join and leave
operations.

Add support via /etc/sysconfig/cman or distro equivalent using
CMAN_JOIN_OPTS and CMAN_LEAVE_OPTS config options.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
---
 cman/init.d/cman.in |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/cman/init.d/cman.in b/cman/init.d/cman.in
index 38c3fbb..fb12d3b 100644
--- a/cman/init.d/cman.in
+++ b/cman/init.d/cman.in
@@ -122,7 +122,16 @@ fi
 #     The default script is "network-bridge".
 [ -z "$NETWORK_BRIDGE_SCRIPT" ] && NETWORK_BRIDGE_SCRIPT="network-bridge"
 
-[ -n "$CLUSTERNAME" ] && cman_join_opts="-c $CLUSTERNAME"
+# CMAN_JOIN_OPTS -- allows extra options to be passed to cman_tool when join
+#     operation is performed.
+#     NOTES:
+#	$CLUSTERNAME   automatically appends "-c $CLUSTERNAME"
+#	$NODENAME      automatically appends "-n $NODENAME"
+#	$CONFIG_LOADER automatically appends "-C $CONFIG_LOADER"
+
+[ -n "$CMAN_JOIN_OPTS" ] && cman_join_opts="$CMAN_JOIN_OPTS"
+
+[ -n "$CLUSTERNAME" ] && cman_join_opts+="-c $CLUSTERNAME"
 
 [ -n "$NODENAME" ] && cman_join_opts+=" -n $NODENAME"
 
@@ -139,6 +148,10 @@ fi
 # openaisparser   - use internal openais config file parser.
 [ -n "$CONFIG_LOADER" ] && cman_join_opts+=" -C $CONFIG_LOADER"
 
+# CMAN_LEAVE_OPTS -- allows extra options to be passed to cman_tool when leave
+#     operation is performed.
+[ -n "$CMAN_LEAVE_OPTS" ] && cman_leave_opts="$CMAN_LEAVE_OPTS"
+
 # INITLOGLEVEL -- select how verbose the init script should be
 # possible values:
 # quiet           - only one line notification for start/stop operations
@@ -477,7 +490,7 @@ start_cman()
 stop_cman()
 {
 	if cman_running; then
-		errmsg=$( cman_tool -t $CMAN_SHUTDOWN_TIMEOUT \
+		errmsg=$( cman_tool $cman_leave_opts -t $CMAN_SHUTDOWN_TIMEOUT \
 			-w leave $cmanremove 2>&1 ) || return 1
 	fi
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]