From: Ronnie Sahlberg Date: Thu, 6 Sep 2007 01:30:49 +0000 (+1000) Subject: improve the handling of hosts to notify with statd X-Git-Tag: tevent-0.9.20~348^2~2430^2~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=00453a375a8ec1bfeef07a4fd64237477a6282a1;p=thirdparty%2Fsamba.git improve the handling of hosts to notify with statd (This used to be ctdb commit cc87bda7e344bc777b9620a6211e62de4dce4e3b) --- diff --git a/ctdb/config/events.d/60.nfs b/ctdb/config/events.d/60.nfs index b7033ba8d68..311e9f2ef49 100755 --- a/ctdb/config/events.d/60.nfs +++ b/ctdb/config/events.d/60.nfs @@ -15,8 +15,8 @@ PATH=/usr/bin:/bin:/usr/sbin:/sbin:$PATH case $cmd in startup) /bin/mkdir -p /etc/ctdb/state/nfs - /bin/mkdir -p ${STATD_SHARED_DIRECTORY}/${PUBLIC_IP} /bin/mkdir -p /etc/ctdb/state/statd/ip + /bin/mkdir -p $STATD_SHARED_DIRECTORY ctdb_wait_directories "nfslock" "$STATD_SHARED_DIRECTORY" diff --git a/ctdb/config/statd-callout b/ctdb/config/statd-callout index 0c61c4a27ec..6f097be9f65 100755 --- a/ctdb/config/statd-callout +++ b/ctdb/config/statd-callout @@ -14,16 +14,20 @@ loadconfig nfs case "$1" in add-client) + # the callout does not tell us to which ip the client connected + # so we must add it to all the ips that we serve for f in `/bin/ls /etc/ctdb/state/statd/ip/*`; do ip=`/bin/basename $f` [ -d $STATD_SHARED_DIRECTORY/$ip ] || /bin/mkdir $STATD_SHARED_DIRECTORY/$ip - /bin/touch $STATD_SHARED_DIRECTORY/$ip/sm/$2 + /bin/touch $STATD_SHARED_DIRECTORY/$ip/$2 done ;; del-client) + # the callout does not tell us to which ip the client connected + # so we must add it to all the ips that we serve for f in `/bin/ls /etc/ctdb/state/statd/ip/*`; do ip=`/bin/basename $f` - /bin/rm -f $STATD_SHARED_DIRECTORY/$ip/sm/$2 + /bin/rm -f $STATD_SHARED_DIRECTORY/$ip/$2 done ;; notify) @@ -31,10 +35,7 @@ case "$1" in for f in `/bin/ls /etc/ctdb/state/statd/ip/*`; do ip=`/bin/basename $f` [ -d $STATD_SHARED_DIRECTORY/$ip ] && [ -x /usr/bin/smnotify ] && { - /bin/rm -rf /tmp/statd/$ip - /bin/mkdir -p /tmp/statd/$ip - /bin/cp $STATD_SHARED_DIRECTORY/$ip/sm/* /tmp/statd/$ip - for g in `/bin/ls /tmp/statd/$ip/*`; do + for g in `/bin/ls $STATD_SHARED_DIRECTORY/$ip/*`; do client=`/bin/basename $g` # send the notifications twice so we force the other # end to recognice a state change has occured and that @@ -42,6 +43,7 @@ case "$1" in # /usr/bin/smnotify --client=$client --ip=$ip --server=$ip --stateval=4 /usr/bin/smnotify --client=$client --ip=$ip --server=$ip --stateval=5 + /bin/rm -f $g done } done