Rev 617: fixed script errors in 10.interface in http://samba.org/~tridge/ctdb

tridge at samba.org tridge at samba.org
Thu Sep 13 01:19:31 GMT 2007


------------------------------------------------------------
revno: 617
revision-id: tridge at samba.org-20070913011930-13zaq9qtw3gugvx8
parent: tridge at samba.org-20070913004506-ywad38uvgtmboy8i
committer: Andrew Tridgell <tridge at samba.org>
branch nick: tridge.test2
timestamp: Thu 2007-09-13 11:19:30 +1000
message:
  fixed script errors in 10.interface
modified:
  config/events.d/10.interface   10.interface-20070604050809-s21zslfirn07zjt8-1
=== modified file 'config/events.d/10.interface'
--- a/config/events.d/10.interface	2007-09-13 00:24:48 +0000
+++ b/config/events.d/10.interface	2007-09-13 01:19:30 +0000
@@ -16,7 +16,7 @@
 }
 
 [ ! -f "$CTDB_PUBLIC_ADDRESSES" ] && {
-	echo "No public addresses file found. Nothing to do for 10.interfaces"
+	echo "`date` No public addresses file found. Nothing to do for 10.interfaces"
 	exit 0
 }
 
@@ -35,16 +35,16 @@
 	ctdb killtcp $srcip:$srcport $destip:$destport >/dev/null 2>&1 || _failed=1
 	_killcount=`expr $_killcount + 1`
     done
-    [ _failed = 0 ] || {
-	echo "Failed to send killtcp control"
+    [ $_failed = 0 ] || {
+	echo "`date` Failed to send killtcp control"
 	return;
     }
     _count=0
-    while netstat -tn | grep $_IP > /dev/null; do
+    while netstat -tn |egrep "^tcp.*\s+$_IP:.*ESTABLISHED" > /dev/null; do
 	sleep 1
 	_count=`expr $_count + 1`
-	[ $_count -gt 5 ] && {
-	    echo "Timed out killing tcp connections for IP $_IP"
+	[ $_count -gt 3 ] && {
+	    echo "`date` Timed out killing tcp connections for IP $_IP"
 	    return;
 	}
     done
@@ -67,7 +67,7 @@
      # called when ctdbd wants to claim an IP address
      takeip)
 	if [ $# != 3 ]; then
-	   echo "must supply interface, IP and maskbits"
+	   echo "`date` must supply interface, IP and maskbits"
 	   exit 1
 	fi
 	iface=$1



More information about the samba-cvs mailing list