. "${CTDB_BASE}/functions"
-loadconfig
+load_script_options
+
+ctdb_setup_state_dir "service" "reclock"
+
+ctdb_get_reclock_option ()
+{
+ _reclock_opt_file="${CTDB_SCRIPT_VARDIR}/recovery_lock.cache"
+
+ if [ -f "$_reclock_opt_file" ] ; then
+ . "$_reclock_opt_file"
+ return
+ fi
+
+ ctdb_translate_option "cluster" \
+ "recovery lock" \
+ "CTDB_RECOVERY_LOCK" >"$_reclock_opt_file"
+
+ . "$_reclock_opt_file"
+}
+
+ctdb_get_reclock_option
# If CTDB_RECOVERY_LOCK specifies a helper then exit because this
# script can't do anything useful.
) >/dev/null 2>&1 &
ctdb_counter_incr
- if ! ctdb_check_counter "quiet" -ge 200 ; then
+ num_fails=$(ctdb_counter_get)
+ if [ "$num_fails" -ge 200 ] ; then
echo "Reclock file \"$CTDB_RECOVERY_LOCK\" can not be accessed. Shutting down."
df
sleep 1
$CTDB shutdown
+ exit 1
+ elif [ "$num_fails" -ge 4 ] ; then
+ die "ERROR: ${num_fails} consecutive failures checking reclock"
fi
-
- ctdb_check_counter "error" -gt 3
;;
esac