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
-
- _count=$(($_count + 1))
- if [ $_count -gt 3 ] ; then
- echo "Timed out killing tcp connections for IP $_ip ($_remaining remaining)"
- return
- fi
+ 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)"
}
}
ok <<EOF
Killing TCP connection 10.254.254.1:43210 ${ip}:445
$out
-Waiting for 1 connections to be killed for IP ${ip}
-Waiting for 1 connections to be killed for IP ${ip}
-Waiting for 1 connections to be killed for IP ${ip}
-Timed out killing tcp connections for IP $ip (1 remaining)
+Failed to kill TCP connections for IP 10.0.0.3 (1/11 remaining)
EOF
simple_test $dev $ip $bits