]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
use the socketkiller to kill off all lock manager sessions as well
authorRonnie Sahlberg <sahlberg@ronnie>
Tue, 10 Jul 2007 03:09:35 +0000 (13:09 +1000)
committerRonnie Sahlberg <sahlberg@ronnie>
Tue, 10 Jul 2007 03:09:35 +0000 (13:09 +1000)
(This used to be ctdb commit 980b090001ed3a77001e2a3bfc1b03833498f434)

ctdb/config/events.d/60.nfs

index 7a7dcd389bdca70482fca98f08689ed6d93448b2..7f0710c4006d817fc77c6f7f7dfdd969bb235060 100755 (executable)
@@ -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`