diff options
author | Martin Schwenke <martin@meltin.net> | 2018-04-20 12:20:34 +1000 |
---|---|---|
committer | Amitay Isaacs <amitay@samba.org> | 2018-05-17 04:04:31 +0200 |
commit | 9b099431fd02c9a8c3a5bfc52fa42d6d891bef59 (patch) | |
tree | 194fa7ac9507d10be129c526c04129fa14301d8c /ctdb/config | |
parent | 2bc6be1e4f77245441950719757893ac28a984c7 (diff) | |
download | samba-9b099431fd02c9a8c3a5bfc52fa42d6d891bef59.tar.gz |
ctdb-scripts: Fetch recovery lock option from config file in 01.reclock
Put it in a function so it is easy to move to common code just in case
it is needed somewhere else.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb/config')
-rwxr-xr-x | ctdb/config/events.d/01.reclock | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/ctdb/config/events.d/01.reclock b/ctdb/config/events.d/01.reclock index e2e4c0da4b0..e14d8c22f48 100755 --- a/ctdb/config/events.d/01.reclock +++ b/ctdb/config/events.d/01.reclock @@ -10,6 +10,24 @@ 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. case "$CTDB_RECOVERY_LOCK" in |