1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00
samba-mirror/ctdb/config/events.d/99.timeout
Martin Schwenke 65ce5e2129 ctdb-scripts: Use load_script_options in event scripts
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2018-03-28 02:57:21 +02:00

26 lines
515 B
Bash
Executable File

#!/bin/sh
#
# Event script to just sleep longer than the timeout
# in the monitor action. The purpose is to trigger
# the event timeout mechanism.
[ -n "$CTDB_BASE" ] || \
CTDB_BASE=$(d=$(dirname "$0") ; cd -P "$d" ; dirname "$PWD")
. "${CTDB_BASE}/functions"
load_script_options
[ "$CTDB_RUN_TIMEOUT_MONITOR" = "yes" ] || exit 0
case "$1" in
monitor)
TIMEOUT=$($CTDB getvar EventScriptTimeout | awk '{print $3}')
echo "sleeping for $((TIMEOUT * 2)) seconds..."
sleep $((TIMEOUT * 2))
;;
esac
exit 0