param: remove two unused #defines
[Samba.git] / ctdb / config / events.d / 01.reclock
blobed7afdd78aa89ca4c67cfc3aaf53f049aeef4f22
1 #!/bin/sh
2 # script to check accessibility to the reclock file on a node
4 [ -n "$CTDB_BASE" ] || \
5 export CTDB_BASE=$(cd -P $(dirname "$0") ; dirname "$PWD")
7 . $CTDB_BASE/functions
8 loadconfig
10 case "$1" in
11 init)
12 ctdb_counter_init
15 monitor)
16 # Early exit if not using a reclock file
17 [ -n "$CTDB_RECOVERY_LOCK" ] || exit 0
19 # Try to stat the reclock file as a background process so that
20 # we don't block in case the cluster filesystem is unavailable
22 if stat $CTDB_RECOVERY_LOCK ; then
23 # We could stat the file, reset the counter
24 ctdb_counter_init
26 ) >/dev/null 2>&1 &
28 ctdb_counter_incr
29 if ! ctdb_check_counter "quiet" -ge 200 ; then
30 echo "Reclock file \"$CTDB_RECOVERY_LOCK\" can not be accessed. Shutting down."
32 sleep 1
33 ctdb shutdown
36 ctdb_check_counter "error" -gt 3
40 ctdb_standard_event_handler "$@"
42 esac
44 exit 0