3 # this script needs to be installed so that statd points to it with the -H
4 # command line argument. The easiest way to do that is to put something like this in
6 # STATD_HOSTNAME="myhostname -H /etc/ctdb/statd-callout"
11 [ -z "$STATD_SHARED_DIRECTORY" ] && exit 0
13 [ -d $STATD_SHARED_DIRECTORY ] || exit 0
17 for f in `/bin/ls /etc/ctdb/state/statd/ip/*`; do
19 [ -d $STATD_SHARED_DIRECTORY/$ip ] || /bin/mkdir $STATD_SHARED_DIRECTORY/$ip
20 /bin/touch $STATD_SHARED_DIRECTORY/$ip/sm/$2
24 for f in `/bin/ls /etc/ctdb/state/statd/ip/*`; do
26 /bin/rm -f $STATD_SHARED_DIRECTORY/$ip/sm/$2
30 # restart the local lock manager and statd
31 /etc/init.d/nfslock stop > /dev/null 2>&1
32 /etc/init.d/nfslock start > /dev/null 2>&1
33 # send out notifications to any additional ips we now serve
34 for f in `/bin/ls /etc/ctdb/state/statd/ip/*`; do
36 [ -d $STATD_SHARED_DIRECTORY/$ip ] && {
37 # we must copy to a different directory since rpc.statd gets
38 # "upset" if sm-notify touches the files.
39 /bin/rm -rf /tmp/statd/$ip
40 /bin/mkdir -p /tmp/statd/$ip
41 /bin/cp -apr $STATD_SHARED_DIRECTORY/$ip/* /tmp/statd/$ip
42 [ -x /usr/sbin/sm-notify ] && /usr/sbin/sm-notify -P /tmp/statd/$ip -v $ip -n