public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
From: "Ryan O'Hara" <rohara@fedoraproject.org>
To: cluster-cvs-relay@redhat.com
Subject: RHEL5 - cman: allow custom xen network bridge scripts
Date: Tue, 02 Sep 2008 15:34:00 -0000	[thread overview]
Message-ID: <20080829150821.33F60120385@lists.fedorahosted.org> (raw)

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=e9fec5cf0724fa209b0c0dc39e71a2c5ac72f36d
Commit:        e9fec5cf0724fa209b0c0dc39e71a2c5ac72f36d
Parent:        917db8b990bff1268b93061f4512a37b0d47f38a
Author:        Ryan O'Hara <rohara@redhat.com>
AuthorDate:    Fri Aug 29 10:07:38 2008 -0500
Committer:     Ryan O'Hara <rohara@redhat.com>
CommitterDate: Fri Aug 29 10:07:38 2008 -0500

cman: allow custom xen network bridge scripts

This patch allows users to define custom scripts for Xen network
bridging. Previously, the name of the Xen network bridge was
hard-coded in the cman init script. Users that wish to use custom Xen
network bridge script should define NETWORK_BRIDGE_SCRIPT in
/etc/sysconfig/cman. This script must exist in the /etc/xen/scripts
directory. Users must also update the /etc/xen/xend-config.sxp file
accordingly.
---
 cman/init.d/cman |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/cman/init.d/cman b/cman/init.d/cman
index 4156b98..35b121b 100755
--- a/cman/init.d/cman
+++ b/cman/init.d/cman
@@ -50,6 +50,11 @@
 #     to join the fence domain (equivalent to "yes").
 [ -z "$FENCE_JOIN" ] && FENCE_JOIN="yes"
 
+# NETWORK_BRIDGE_SCRIPT -- script to use for xen network bridging.
+#     This script must exist in the /etc/xen/scripts directory.
+#     The default script is "network-bridge".
+[ -z "$NETWORK_BRIDGE_SCRIPT" ] && NETWORK_BRIDGE_SCRIPT="network-bridge"
+
 [ -z "$LOCK_FILE" ] && LOCK_FILE="/var/lock/subsys/cman"
 
 [ -n "$CLUSTERNAME" ] && cman_join_opts="-c $CLUSTERNAME"
@@ -203,7 +208,7 @@ xend_bridged_net_enabled() {
         return 1
     fi
 
-    egrep "^[[:blank:]]*\([[:blank:]]*network-script[[:blank:]]+(')?[[:blank:]]*network-bridge([[:blank:]]*\)|[[:blank:]]+)" /etc/xen/xend-config.sxp >&/dev/null
+    egrep "^[[:blank:]]*\([[:blank:]]*network-script[[:blank:]]+(')?[[:blank:]]*${NETWORK_BRIDGE_SCRIPT}([[:blank:]]*\)|[[:blank:]]+)" /etc/xen/xend-config.sxp >&/dev/null
     if [ $? -ne 0 ]; then
         # xend isn't configured to use bridged networking.
         return 1
@@ -212,8 +217,8 @@ xend_bridged_net_enabled() {
 }
 
 xend_bridged_net_start() {
-    if [ ! -x /etc/xen/scripts/network-bridge ]; then
-        if [ -f /etc/xen/scripts/network-bridge ]; then
+    if [ ! -x /etc/xen/scripts/${NETWORK_BRIDGE_SCRIPT} ]; then
+        if [ -f /etc/xen/scripts/${NETWORK_BRIDGE_SCRIPT} ]; then
             errmsg='The xend bridged network script cannot be run'
         else
             errmsg='The xend bridged network script is missing'
@@ -223,8 +228,8 @@ xend_bridged_net_start() {
 
     /sbin/modprobe netbk >& /dev/null
     /sbin/modprobe netloop >& /dev/null
-    bridge_parms=`egrep -m 1 "^[[:blank:]]*\([[:blank:]]*network-script[[:blank:]]+(')?[[:blank:]]*network-bridge([[:blank:]]*\)|[[:blank:]]+)" /etc/xen/xend-config.sxp| sed -r "s/^[[:blank:]]*\([[:blank:]]*network-script[[:blank:]]+'?[[:blank:]]*network-bridge[[:blank:]]*//; s/'?[[:blank:]]*\).*//"`
-    errmsg=$(/etc/xen/scripts/network-bridge start $bridge_parms 2>&1) || return 1
+    bridge_parms=`egrep -m 1 "^[[:blank:]]*\([[:blank:]]*network-script[[:blank:]]+(')?[[:blank:]]*${NETWORK_BRIDGE_SCRIPT}([[:blank:]]*\)|[[:blank:]]+)" /etc/xen/xend-config.sxp| sed -r "s/^[[:blank:]]*\([[:blank:]]*network-script[[:blank:]]+'?[[:blank:]]*${NETWORK_BRIDGE_SCRIPT}[[:blank:]]*//; s/'?[[:blank:]]*\).*//"`
+    errmsg=$(/etc/xen/scripts/${NETWORK_BRIDGE_SCRIPT} start $bridge_parms 2>&1) || return 1
     return 0
 }
 


                 reply	other threads:[~2008-08-29 15:09 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=20080829150821.33F60120385@lists.fedorahosted.org \
    --to=rohara@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).