[SCM] CTDB repository - branch master updated - ctdb-1.0.57-30-gd9779c3

Ronnie Sahlberg sahlberg at samba.org
Tue Oct 7 00:05:00 GMT 2008


The branch, master has been updated
       via  d9779c310e98c9d4eab71a8d1705849ac90deb10 (commit)
      from  85f6032cbdb197f3a003d86f086afa2cee898a4d (commit)

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


- Log -----------------------------------------------------------------
commit d9779c310e98c9d4eab71a8d1705849ac90deb10
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Tue Oct 7 11:03:30 2008 +1100

    add a new eventscript : 99.routing that is used to add static routes to
    interfaces when they are activated (an ip address is added during
    takeip)

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

Summary of changes:
 config/events.d/99.routing |   37 +++++++++++++++++++++++++++++++++++++
 1 files changed, 37 insertions(+), 0 deletions(-)
 create mode 100755 config/events.d/99.routing


Changeset truncated at 500 lines:

diff --git a/config/events.d/99.routing b/config/events.d/99.routing
new file mode 100755
index 0000000..dd0a6c3
--- /dev/null
+++ b/config/events.d/99.routing
@@ -0,0 +1,37 @@
+#!/bin/sh
+# script to add entries to the routing table after we have performed a
+# take ip event
+# (when we do a "releaseip" event and remove an ip address from an interface
+#  the kernel might automatically remove associated entries from
+#  the routing table. This is where we add them back)
+#
+# Routes to add are defined in /etc/ctdb/static-routes.
+# Syntax is :
+# IFACE NET/MASK GATEWAY
+#
+# Example
+# bond1 10.3.3.0/24 10.0.0.1
+
+. $CTDB_BASE/functions
+loadconfig ctdb
+
+[ -f $CTDB_BASE/static-routes ] || {
+    exit 0
+}
+
+cmd="$1"
+shift
+PATH=/usr/bin:/bin:/usr/sbin:/sbin:$PATH
+
+case $cmd in 
+     takeip)
+	iface=$1
+	cat $CTDB_BASE/static-routes | egrep "^$iface " | while read IFACE DEST GW; do
+		ip route add $DEST via $GW 2>/dev/null >/dev/null
+	done
+
+	;;
+
+esac
+
+exit 0


-- 
CTDB repository


More information about the samba-cvs mailing list