2 # ctdb event script for NFS tickle acks
10 service_start
="mkdir -p $CTDB_BASE/state/nfstickle;mkdir -p $NFS_TICKLE_SHARED_DIRECTORY/`hostname`;echo 1 > /proc/sys/net/ipv4/tcp_tw_recycle"
11 service_reconfigure
=$service_start
13 ctdb_start_stop_service
15 [ -z "$NFS_TICKLE_SHARED_DIRECTORY" ] && exit 0
25 # first send a grat arp, to ensure the client knows the updated
26 # mac address for this IP
27 ctdb gratiousarp
$ip $iface
28 # send tickle acks for all the connections the old server had
29 for f
in $NFS_TICKLE_SHARED_DIRECTORY/*/$ip; do
30 [ -f $f ] && cat $f |
while read dest
; do
31 # send three, in case of lost packets
32 echo "Sending NFS tickle ack for $ip to $dest"
33 for i
in `seq 1 3`; do
34 ctdb tickle
$dest $ip:2049
41 mydir
=$NFS_TICKLE_SHARED_DIRECTORY/`hostname`
43 # record our connections to shared storage
44 netstat
-tn |
egrep '^tcp[[:space:]]+[0-9]+[[:space:]]+[0-9]+[[:space:]]+[0-9\.]+:2049.*ESTABLISHED' |
45 awk '{print $4" "$5}' |
46 while read dest src
; do
48 echo $src >> $mydir/$ip
53 ctdb_standard_event_handler
"$@"