2 # script to check accessibility to the reclock file on a node
4 [ -n "$CTDB_BASE" ] || \
5 CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
7 . "${CTDB_BASE}/functions"
11 # If CTDB_RECOVERY_LOCK specifies a helper then exit because this
12 # script can't do anything useful.
13 case "$CTDB_RECOVERY_LOCK" in
21 if [ -n "$CTDB_RECOVERY_LOCK" ] ; then
22 d=$(dirname "$CTDB_RECOVERY_LOCK")
28 # Early exit if not using a reclock file
29 [ -n "$CTDB_RECOVERY_LOCK" ] || exit 0
31 # Try to stat the reclock file as a background process so that
32 # we don't block in case the cluster filesystem is unavailable
34 if stat "$CTDB_RECOVERY_LOCK" ; then
35 # We could stat the file, reset the counter
41 if ! ctdb_check_counter "quiet" -ge 200 ; then
42 echo "Reclock file \"$CTDB_RECOVERY_LOCK\" can not be accessed. Shutting down."
48 ctdb_check_counter "error" -gt 3
52 ctdb_standard_event_handler "$@"