diff --git a/ctdb/config/functions b/ctdb/config/functions index aab7a143529..7c28e4ce04b 100755 --- a/ctdb/config/functions +++ b/ctdb/config/functions @@ -464,29 +464,21 @@ kill_tcp_connections () return fi - echo "$_connections" | ctdb killtcp || { - echo "Failed to send killtcp control" - return + echo "$_connections" | \ + "${CTDB_HELPER_BINDIR}/ctdb_killtcp" "$_iface" || { + echo "Failed to kill TCP connections" + return } - _count=0 - while : ; do - _remaining=$(get_tcp_connections_for_ip $_ip | wc -l) + _remaining=$(get_tcp_connections_for_ip $_ip | wc -l) - if [ $_remaining -eq 0 ] ; then + if [ $_remaining -eq 0 ] ; then echo "Killed $_killcount TCP connections to released IP $_ip" return - fi + fi - _count=$(($_count + 1)) - if [ $_count -gt 3 ] ; then - echo "Timed out killing tcp connections for IP $_ip ($_remaining remaining)" - return - fi - - echo "Waiting for $_remaining connections to be killed for IP $_ip" - sleep 1 - done + _t="${_remaining}/${_killcount}" + echo "Failed to kill TCP connections for IP $_ip (${_t} remaining)" } } diff --git a/ctdb/tests/eventscripts/10.interface.releaseip.011.sh b/ctdb/tests/eventscripts/10.interface.releaseip.011.sh index e1514eea880..6203b97e2f5 100755 --- a/ctdb/tests/eventscripts/10.interface.releaseip.011.sh +++ b/ctdb/tests/eventscripts/10.interface.releaseip.011.sh @@ -31,10 +31,7 @@ while read dev ip bits ; do ok <