[SCM] CTDB repository - branch master updated - ctdb-1.10-232-g771b1e9

Ronnie Sahlberg sahlberg at samba.org
Tue Aug 2 03:32:17 MDT 2011


The branch, master has been updated
       via  771b1e9c2e694ccc8825fb8088174c122532e74d (commit)
       via  49b2d1bd9554461ed8edbfc21e777c0eca9e1443 (commit)
      from  518945e59e2e48f07fcc0955f3aa81cd0d946aea (commit)

http://gitweb.samba.org/?p=ctdb.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 771b1e9c2e694ccc8825fb8088174c122532e74d
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Tue Aug 2 19:25:14 2011 +1000

    make test: add two missing events to the special test eventscript

commit 49b2d1bd9554461ed8edbfc21e777c0eca9e1443
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Aug 1 13:37:06 2011 +1000

    Eventscripts - 10.interfaces should not check orphaned interfaces.
    
    If the last IP address on an interfaces is removed then that
    interfaces should no longer be checked by 10.interfaces.  However,
    "ctdb ifaces" still lists such interfaces so they are currently
    checked.
    
    The problem really needs to be addressed in ctdbd but a neat quick
    eventscript fix will be minimally invasive...
    
    This changes the code to use "ctdb -Y ip -v" instead of "ctdb -Y
    ifaces".  The former includes details of all public addresses and
    associated interfaces, so when an address is removed there is no
    output for it.  This avoids orphaned interfaces from being listed.
    
    The logic is also slightly improved so that $IFACES includes just a
    (non-uniquified) list of interfaces, allowing an existing loop to be
    removed.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

-----------------------------------------------------------------------

Summary of changes:
 config/events.d/10.interface |   13 +++++--------
 tests/events.d/00.test       |   11 +++++++++++
 2 files changed, 16 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/config/events.d/10.interface b/config/events.d/10.interface
index 7f5791a..ecaa323 100755
--- a/config/events.d/10.interface
+++ b/config/events.d/10.interface
@@ -24,17 +24,14 @@ monitor_interfaces()
 	[ "$CTDB_PUBLIC_INTERFACE" ] && INTERFACES="$CTDB_PUBLIC_INTERFACE $INTERFACES"
 	[ "$CTDB_NATGW_PUBLIC_IFACE" ] && INTERFACES="$CTDB_NATGW_PUBLIC_IFACE $INTERFACES"
 
-	local IFACES=`ctdb ifaces -Y | grep -v '^:Name:LinkStatus:References:'`
 
-	local I
-	local IFACE
+	# For all but the 1st line, get the 2nd last field with commas
+	# changes to spaces.
+	local IFACES=`ctdb -Y ip -v | sed -e '1d' -e 's/:[^:]*:$//' -e 's/^.*://' -e 's/,/ /g'`
 
-	for I in $IFACES; do
-		IFACE=`echo -n "$I" | cut -d ':' -f2`
-		INTERFACES="$IFACE $INTERFACES"
-	done
+	local IFACE
 
-	INTERFACES=`for IFACE in $INTERFACES ; do echo $IFACE ; done | sort | uniq`
+	INTERFACES=`for IFACE in $INTERFACES $IFACES ; do echo $IFACE ; done | sort | uniq`
 
 	local fail=0
 	local ok=0
diff --git a/tests/events.d/00.test b/tests/events.d/00.test
index 7f64071..49b741b 100755
--- a/tests/events.d/00.test
+++ b/tests/events.d/00.test
@@ -73,11 +73,22 @@ case $cmd in
 	exit 0
 	;;
 
+     updateip)
+	echo "ctdb updateip event for $1"
+	exit 0
+	;;
+
      recovered)
 	echo "ctdb recovered event"
 	exit 0
 	;;
 
+     ipreallocated)
+	echo "ctdb ipreallocated event"
+	exit 0
+	;;
+
+
      shutdown)
 	echo "ctdb shutdown event"
 	exit 0


-- 
CTDB repository


More information about the samba-cvs mailing list