From: Ronnie Sahlberg Date: Tue, 10 Jul 2007 03:09:35 +0000 (+1000) Subject: use the socketkiller to kill off all lock manager sessions as well X-Git-Tag: tevent-0.9.20~348^2~2462^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ed1a52b29301bb2fdff4498f6eb38b4a1e49d7e0;p=thirdparty%2Fsamba.git use the socketkiller to kill off all lock manager sessions as well (This used to be ctdb commit 980b090001ed3a77001e2a3bfc1b03833498f434) --- diff --git a/ctdb/config/events.d/60.nfs b/ctdb/config/events.d/60.nfs index 7a7dcd389bd..7f0710c4006 100755 --- a/ctdb/config/events.d/60.nfs +++ b/ctdb/config/events.d/60.nfs @@ -61,10 +61,24 @@ case $cmd in ;; 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`