;;
recovered)
- # RST all tcp connections used for NFS to ensure that they do
- # not survive in ESTABLISHED state across a failover/failback
- # and create an ack storm
+ [ -f /etc/ctdb/state/nfs/restart ] && [ ! -z "$LOCKD_TCPPORT" ] && {
+ # RST all tcp connections used for NLM to ensure that they do
+ # not survive in ESTABLISHED state across a failover/failback
+ # and create an ack storm
+ netstat -tn |egrep "^tcp.*\s+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:${LOCKD_TCPPORT}\s+.*ESTABLISHED" | awk '{print $4" "$5}' | while read dest src; do
+ srcip=`echo $src | cut -d: -f1`
+ srcport=`echo $src | cut -d: -f2`
+ destip=`echo $dest | cut -d: -f1`
+ destport=`echo $dest | cut -d: -f2`
+ ctdb killtcp $srcip:$srcport $destip:$destport 1 >/dev/null 2>&1
+# ctdb killtcp $destip:$destport $srcip:$srcport 1 >/dev/null 2>&1
+ done
+ } > /dev/null 2>&1
+
[ -f /etc/ctdb/state/nfs/restart ] && {
+ # RST all tcp connections used for NFS to ensure that they do
+ # not survive in ESTABLISHED state across a failover/failback
+ # and create an ack storm
netstat -tn |egrep '^tcp.*\s+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:2049\s+.*ESTABLISHED' | awk '{print $4" "$5}' | while read dest src; do
srcip=`echo $src | cut -d: -f1`
srcport=`echo $src | cut -d: -f2`