mirror of
https://github.com/samba-team/samba.git
synced 2025-03-27 22:50:26 +03:00
ctdb-scripts: Improve messages about invalid tunables during "setup"
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Wed Feb 18 08:03:33 CET 2015 on sn-devel-104
This commit is contained in:
parent
c3706e7fb0
commit
dc32f11b87
@ -119,14 +119,19 @@ update_config_from_tdb() {
|
||||
fi
|
||||
}
|
||||
|
||||
set_ctdb_variables () {
|
||||
set_ctdb_variables ()
|
||||
{
|
||||
# set any tunables from the config file
|
||||
set | sed -n '/^CTDB_SET_/s/=.*//p' |
|
||||
while read v; do
|
||||
varname="${v#CTDB_SET_}"
|
||||
value=$(eval echo "\$$v")
|
||||
ctdb setvar $varname $value || return 1
|
||||
echo "Set $varname to $value"
|
||||
if ctdb setvar $varname $value ; then
|
||||
echo "Set $varname to $value"
|
||||
else
|
||||
echo "Invalid configuration: CTDB_SET_${varname}=${value}"
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
@ -198,7 +203,8 @@ case "$1" in
|
||||
|
||||
setup)
|
||||
# Set any tunables from the config file
|
||||
set_ctdb_variables || die "Failed to set CTDB tunables"
|
||||
set_ctdb_variables || \
|
||||
die "Aborting setup due to invalid configuration - fix typos, remove unknown tunables"
|
||||
;;
|
||||
|
||||
startup)
|
||||
|
@ -14,7 +14,8 @@ EOF
|
||||
required_result 1 <<EOF
|
||||
Set MonitorInterval to 5
|
||||
Unable to set tunable variable 'UnknownMagic'
|
||||
Failed to set CTDB tunables
|
||||
Invalid configuration: CTDB_SET_UnknownMagic=0
|
||||
Aborting setup due to invalid configuration - fix typos, remove unknown tunables
|
||||
EOF
|
||||
|
||||
simple_test
|
||||
|
Loading…
x
Reference in New Issue
Block a user