allow setting of variables at startup in config file
authorAndrew Tridgell <tridge@samba.org>
Mon, 4 Jun 2007 10:05:31 +0000 (20:05 +1000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 4 Jun 2007 10:05:31 +0000 (20:05 +1000)
config/ctdb.sysconfig
config/events

index 6b1091d95790e4828032ccf0c11b20225576cccd..3e569961bbb49baacf180a06f550bd63cfbeb935 100644 (file)
 # 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=
 
index 24b018446d6199072bbbf34f6ab966a2c5996ea7..b1b99c19eadbba87e3724d4197c61daa43f1dac6 100755 (executable)
@@ -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