diff options
author | Martin Schwenke <martin@meltin.net> | 2012-10-11 14:34:37 +1100 |
---|---|---|
committer | Martin Schwenke <martin@meltin.net> | 2012-10-18 20:05:42 +1100 |
commit | 66d0aba85be31643a8525faf80f8ad797d70b40d (patch) | |
tree | 27635f5eb6f61439431e910040d02dbc12da7406 | |
parent | 34a6c07e99720b9c199d9b3d094ef727c3cfa336 (diff) | |
download | samba-66d0aba85be31643a8525faf80f8ad797d70b40d.tar.gz samba-66d0aba85be31643a8525faf80f8ad797d70b40d.tar.xz samba-66d0aba85be31643a8525faf80f8ad797d70b40d.zip |
Revert "Eventscripts - add facility to 10.interface to delete unmanaged IPs"
This reverts commit 88f88d86b0d08240f749fb721b8c401c2eeb1099.
This is dangerous and, on reflection, I can't see it being useful.
There are often permanent IPs on interfaces that CTDB shares with its
public IPs.
(This used to be ctdb commit 16aba4eb620844626a1c71c58b51658caf44dea6)
-rwxr-xr-x | ctdb/config/events.d/10.interface | 29 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/10.interface.monitor.015.sh | 22 |
2 files changed, 0 insertions, 51 deletions
diff --git a/ctdb/config/events.d/10.interface b/ctdb/config/events.d/10.interface index a425e27c60..dd54f1e395 100755 --- a/ctdb/config/events.d/10.interface +++ b/ctdb/config/events.d/10.interface @@ -49,39 +49,10 @@ get_all_interfaces () all_interfaces=$(echo $all_interfaces $ctdb_ifaces | tr ' ' '\n' | sort -u) } -delete_unexpected_ips () -{ - [ "$CTDB_DELETE_UNEXPECTED_IPS" = "yes" ] || return - - for _i in $all_interfaces ; do - # Get the IPs actually on this interface - _ips=$(ip addr show dev "$_i" | \ - sed -n -e 's@.*inet[[:space:]]*\([^[:space:]]*\).*scope global.*@\1@p') - for _ip in $_ips ; do - - # The NATGW address is OK - if [ "$CTDB_NATGW_PUBLIC_IP" = "$_ip" -a \ - "$CTDB_NATGW_PUBLIC_IFACE" = "$_i" ] ; then - continue - fi - - # If CTDB knows about the address then it is OK - if ctdb ipinfo "${_ip%/*}" >/dev/null 2>&1 ; then - continue - fi - - echo "WARNING: Removing unmanaged IP address $_ip from interface $_i" - delete_ip_from_iface "$_i" "${_ip%/*}" "${_ip#*/}" - done - done -} - monitor_interfaces() { get_all_interfaces - delete_unexpected_ips - fail=false up_interfaces_found=false diff --git a/ctdb/tests/eventscripts/10.interface.monitor.015.sh b/ctdb/tests/eventscripts/10.interface.monitor.015.sh deleted file mode 100755 index ff54b69d9b..0000000000 --- a/ctdb/tests/eventscripts/10.interface.monitor.015.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -. "${TEST_SCRIPTS_DIR}/unit.sh" - -define_test "spurious addresses on interface, delete them" - -setup_ctdb - -iface=$(ctdb_get_1_interface) - -ip addr add 192.168.253.253/24 dev $iface -ip addr add 192.168.254.254/24 dev $iface - -export CTDB_DELETE_UNEXPECTED_IPS="yes" - -ok <<EOF -WARNING: Removing unmanaged IP address 192.168.253.253/24 from interface dev123 -Re-adding secondary address 192.168.254.254/24 to dev dev123 -WARNING: Removing unmanaged IP address 192.168.254.254/24 from interface dev123 -EOF - -simple_test |