From: Andrew Tridgell Date: Mon, 4 Jun 2007 10:05:31 +0000 (+1000) Subject: allow setting of variables at startup in config file X-Git-Tag: tevent-0.9.20~348^2~2573 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fcce534f23393b9319ad70df09450baa39affd61;p=thirdparty%2Fsamba.git allow setting of variables at startup in config file (This used to be ctdb commit db39ca7c0ee1441113ac3279cb75b3cb38eecd1b) --- diff --git a/ctdb/config/ctdb.sysconfig b/ctdb/config/ctdb.sysconfig index 6b1091d9579..3e569961bbb 100644 --- a/ctdb/config/ctdb.sysconfig +++ b/ctdb/config/ctdb.sysconfig @@ -51,6 +51,14 @@ # the default is 0 # CTDB_DEBUGLEVEL=0 +# set any default tuning options for ctdb +# use CTDB_SET_XXXX=value where XXXX is the name of the tuning +# variable +# for example +# CTDB_SET_TRAVERSETIMEOUT=60 +# you can get a list of variables using "ctdb listvars" + + # any other options you might want. Run ctdbd --help for a list # CTDB_OPTIONS= diff --git a/ctdb/config/events b/ctdb/config/events index 24b018446d6..b1b99c19ead 100755 --- a/ctdb/config/events +++ b/ctdb/config/events @@ -21,6 +21,15 @@ case $cmd in # make sure we have a blank state directory for the scripts to work with /bin/rm -rf /etc/ctdb/state /bin/mkdir -p /etc/ctdb/state + + # set any tunables from the config file + set | grep ^CTDB_SET_ | cut -d_ -f3- | + while read v; do + varname=`echo $v | cut -d= -f1` + value=`echo $v | cut -d= -f2` + ctdb setvar $varname $value || exit 1 + echo "`date` Set $varname to $value" + done ;; esac