Eventscript support - Remove unused interface_modify.sh
authorMartin Schwenke <martin@meltin.net>
Wed, 7 Mar 2012 05:20:24 +0000 (16:20 +1100)
committerMartin Schwenke <martin@meltin.net>
Thu, 22 Mar 2012 04:30:27 +0000 (15:30 +1100)
Signed-off-by: Martin Schwenke <martin@meltin.net>
Makefile.in
config/README
config/interface_modify.sh [deleted file]
packaging/RPM/ctdb.spec.in

index 9055a8f64dd013fc146cb9c319c86dd4cadf4b3e..90d7b085ccaa6b604239da5820f8455d864c93cd 100755 (executable)
@@ -315,7 +315,6 @@ install: all $(PMDA_INSTALL)
        ${INSTALLCMD} -m 644 include/ctdb_typesafe_cb.h $(DESTDIR)$(includedir)
        ${INSTALLCMD} -m 644 config/functions $(DESTDIR)$(etcdir)/ctdb
        ${INSTALLCMD} -m 755 config/statd-callout $(DESTDIR)$(etcdir)/ctdb
-       ${INSTALLCMD} -m 755 config/interface_modify.sh $(DESTDIR)$(etcdir)/ctdb
        ${INSTALLCMD} -m 644 config/events.d/README $(DESTDIR)$(docdir)/ctdb/README.eventscripts
        ${INSTALLCMD} -m 644 doc/recovery-process.txt $(DESTDIR)$(docdir)/ctdb/recovery-process.txt
        ${INSTALLCMD} -m 755 config/events.d/00.ctdb $(DESTDIR)$(etcdir)/ctdb/events.d
index f2457a76185dff720c9ace2e0d682a2ec6fba1a6..ffbeb0e690bac81a0e3da0677349f20dad95cf60 100644 (file)
@@ -14,12 +14,6 @@ Selected highlights:
 
     Support functions, sourced by eventscripts and other scripts.
 
-  interface_modify.sh
-
-    Script to support add/remove IPs and other funky stuff.  Not sure
-    why this is separate... but it certainly allows easy wrapping by
-    flock.
-
   statd-callout
 
     rpc.statd high-availability callout to support lock migration on
diff --git a/config/interface_modify.sh b/config/interface_modify.sh
deleted file mode 100755 (executable)
index b0e5190..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/bin/sh
-#
-
-OP=$1
-IFACE=$2
-IP=$3
-MASKBITS=$4
-READD_BASE=$5
-READD_SCRIPT=$6
-
-add_ip_to_iface()
-{
-       local _iface=$1
-       local _ip=$2
-       local _maskbits=$3
-       local _readd_base=$4
-       local _script_dir="$_readd_base/$_ip.$_maskbits"
-
-       # we make sure the interface is up first
-       ip link set $_iface up || {
-               echo "Failed to bringup interface $_iface"
-               return 1;
-       }
-       ip addr add $_ip/$_maskbits brd + dev $_iface || {
-               echo "Failed to add $_ip/$_maskbits on dev $_iface"
-               return 1;
-       }
-
-       mkdir -p $_script_dir || {
-               echo "Failed to mkdir -p $_script_dir"
-               return 1;
-       }
-
-       rm -f $_script_dir/*
-
-       return 0;
-}
-
-delete_ip_from_iface()
-{
-       local _iface=$1
-       local _ip=$2
-       local _maskbits=$3
-       local _readd_base=$4
-       local _script_dir="$_readd_base/$_ip.$_maskbits"
-
-       # the ip tool will delete all secondary IPs if this is the primary. To work around
-       # this _very_ annoying behaviour we have to keep a record of the secondaries and re-add
-       # them afterwards. yuck
-       local _secondaries=""
-       if ip addr list dev $_iface primary | grep -q "inet $_ip/$_maskbits " ; then
-           _secondaries=`ip addr list dev $_iface secondary | grep " inet " | awk '{print $2}'`
-       fi
-       local _failed=0
-       ip addr del $_ip/$_maskbits dev $_iface || _failed=1
-       [ -z "$_secondaries" ] || {
-           local _i=""
-           for _i in $_secondaries; do
-               if ip addr list dev $_iface | grep -q "inet $_i" ; then
-                   echo "kept secondary $_i on dev $_iface"
-               else
-                   echo "re-adding secondary address $_i to dev $_iface"
-                   ip addr add $_i brd + dev $_iface || _failed=1
-               fi
-           done
-       }
-
-       test -d $_script_dir && {
-               rm -f $_script_dir/*
-       }
-
-       [ $_failed = 0 ] || {
-               echo "Failed to del $_ip on dev $_iface"
-               return 1;
-       }
-       return 0;
-}
-
-case "$OP" in
-       add)
-               add_ip_to_iface $IFACE $IP $MASKBITS $READD_BASE
-               exit $?
-               ;;
-       delete)
-               delete_ip_from_iface $IFACE $IP $MASKBITS $READD_BASE
-               exit $?
-               ;;
-esac
-
-echo "$0: unknown operation[$OP]"
-exit 1
index 1d6f5702b75723694e849afabaf3a57fb4fe4cd5..f9a5cefb93b9c26af04b99e18bbe5a12c3e1e2dc 100644 (file)
@@ -112,7 +112,6 @@ rm -rf $RPM_BUILD_ROOT
 %{_sysconfdir}/ctdb/events.d/70.iscsi
 %{_sysconfdir}/ctdb/events.d/91.lvs
 %{_sysconfdir}/ctdb/statd-callout
-%{_sysconfdir}/ctdb/interface_modify.sh
 %{_sbindir}/ctdbd
 %{_bindir}/ctdb
 %{_bindir}/smnotify