1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00
Martin Schwenke ee513c1ba2 More untested eventscript factorisation.
Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit ac655b0a65b32d809d47fec9821f7f31bb2fe2a7)
2009-11-19 15:00:17 +11:00

46 lines
847 B
Bash
Executable File

#!/bin/sh
# script to check accessibility to the reclock file on a node
. $CTDB_BASE/functions
loadconfig
case $cmd in
startup)
ctdb_counter_init
;;
monitor)
ctdb_counter_incr
(ctdb_counter_limit 200 >/dev/null 2>&1) || {
echo "Reclock file \"$RECLOCKFILE\" can not be accessed. Shutting down."
df
sleep 1
ctdb shutdown
}
RECLOCKFILE=$(ctdb -Y getreclock)
[ -z "$RECLOCKFILE" ] && {
# we are not using a reclock file
ctdb_counter_init
exit 0
}
# try stat the reclock file as a background process
# so that we dont block in case the cluster filesystem is unavailable
(
stat $RECLOCKFILE && {
# we could stat the file, reset the counter
ctdb_counter_init
}
) >/dev/null 2>/dev/null &
ctdb_counter_limit 3
;;
status)
ctdb_checkstatus || exit $?
;;
esac
exit 0