Skip to content

Commit

Permalink
ctdb-scripts: Allow load_system_config() to take multiple alternatives
Browse files Browse the repository at this point in the history
The situation for NFS config has got more complicated and is probably
broken in statd-callout on Debian-like systems at the moment.  Allow
several alternative configuration names to be tried.  Stop after the
first that is found and loaded.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13860

Signed-off-by: Martin Schwenke <[email protected]>
Reviewed-by: Amitay Isaacs <[email protected]>
  • Loading branch information
martin-schwenke authored and Martin Schwenke committed Mar 31, 2019
1 parent 95283bd commit 0d67ea5
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions ctdb/config/functions
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,16 @@ fi

load_system_config ()
{
if [ -z "$1" ] ; then
return
fi

if [ -f "${CTDB_SYS_ETCDIR}/sysconfig/$1" ]; then
. "${CTDB_SYS_ETCDIR}/sysconfig/$1"
elif [ -f "${CTDB_SYS_ETCDIR}/default/$1" ]; then
. "${CTDB_SYS_ETCDIR}/default/$1"
fi
for _i ; do

if [ -f "${CTDB_SYS_ETCDIR}/sysconfig/${_i}" ]; then
. "${CTDB_SYS_ETCDIR}/sysconfig/${_i}"
return
elif [ -f "${CTDB_SYS_ETCDIR}/default/${_i}" ]; then
. "${CTDB_SYS_ETCDIR}/default/${_i}"
return
fi
done
}

# load_script_options [ component script ]
Expand Down

0 comments on commit 0d67ea5

Please sign in to comment.