--- /dev/null
+# Set some CTDB tunable variables during CTDB startup?
+# MutexEnabled=0
# Default log level is NOTICE. Want less logging?
# CTDB_DEBUGLEVEL=ERR
-
-# Set some CTDB tunable variables during CTDB startup?
-# CTDB_SET_TDBMutexEnabled=0
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")
- if $CTDB setvar "$varname" "$value" ; then
- echo "Set $varname to $value"
- else
- echo "Invalid configuration: CTDB_SET_${varname}=${value}"
- return 1
+ _f="${CTDB_BASE}/ctdb.tunables"
+ if [ ! -r "$_f" ] ; then
+ return
fi
- done
+
+ while IFS="=" read _var _val ; do
+ case "$_var" in
+ \#*|"") continue ;;
+ esac
+
+ if $CTDB setvar "$_var" "$_val" ; then
+ echo "Set $_var to $_val"
+ else
+ echo "Invalid tunable: ${_var}=${_val}"
+ return 1
+ fi
+ done <"$_f"
}
############################################################
Failure of this event will cause CTDB to terminate.
- Example: 00.ctdb processes tunables defined in the CTDB
- configuration using CTDB_SET_<TunableName>=<TunableValue>.
+ Example: 00.ctdb processes tunables defined in ctdb.tunables.
startup
</para>
<para>
- The tunable variables are listed alphabetically.
+ Tunables can be set at startup from the
+ <filename>/usr/local/etc/ctdb/ctdb.tunables</filename>
+ configuration file.
+
+ <literallayout>
+<replaceable>TUNABLE</replaceable>=<replaceable>VALUE</replaceable>
+ </literallayout>
+ </para>
+
+ <para>
+ For example:
+
+ <screen format="linespecific">
+MonitorInterval=20
+ </screen>
+ </para>
+
+ <para>
+ The available tunable variables are listed alphabetically below.
</para>
<refsect2>
</refsect1>
+ <refsect1>
+ <title>FILES></title>
+
+ <simplelist>
+ <member><filename>/usr/local/etc/ctdb/ctdb.tunables</filename></member>
+ </simplelist>
+ </refsect1>
+
<refsect1>
<title>SEE ALSO</title>
<para>
</refsect1>
- <refsect1>
- <title>
- TUNABLES CONFIGURATION
- </title>
-
- <para>
- CTDB tunables (see
- <citerefentry><refentrytitle>ctdbd-tunables</refentrytitle>
- <manvolnum>7</manvolnum></citerefentry>) can be set from the
- configuration file. They are set as follows:
-
- <literallayout>
-CTDB_SET_<replaceable>TUNABLE</replaceable>=<replaceable>VALUE</replaceable>
- </literallayout>
- </para>
-
- <para>
- For example:
-
- <screen format="linespecific">
-CTDB_SET_MonitorInterval=20
- </screen>
- </para>
- </refsect1>
-
<refsect1>
<title>
DEBUG AND TEST
DESTDIR=$RPM_BUILD_ROOT ./buildtools/bin/waf install
install -m644 config/ctdbd.conf $RPM_BUILD_ROOT%{_sysconfdir}/ctdb
+install -m644 config/ctdb.tunables $RPM_BUILD_ROOT%{_sysconfdir}/ctdb
# Add a pointer to modern location for configuration file. Allow with
# "noreplace" in the files section, this stops RPM moving aside a
%defattr(-,root,root)
%config(noreplace) %{_sysconfdir}/ctdb/ctdbd.conf
+%config(noreplace) %{_sysconfdir}/ctdb/ctdb.tunables
%config(noreplace) %{_sysconfdir}/ctdb/notify.sh
%config(noreplace) %{_sysconfdir}/ctdb/debug-hung-script.sh
%config(noreplace) %{_sysconfdir}/ctdb/ctdb-crash-cleanup.sh
required_result 1 <<EOF
Set MonitorInterval to 5
Unable to set tunable variable 'UnknownMagic'
-Invalid configuration: CTDB_SET_UnknownMagic=0
+Invalid tunable: UnknownMagic=0
Aborting setup due to invalid configuration - fix typos, remove unknown tunables
EOF
EOF
required_result 0 <<EOF
+Set MonitorInterval to 5
Setting obsolete tunable variable 'EventScriptUnhealthyOnTimeout'
Set EventScriptUnhealthyOnTimeout to 0
-Set MonitorInterval to 5
EOF
simple_test
CTDB_DEBUGLEVEL=ERR
-
-if [ -n "$FAKE_CTDB_EXTRA_CONFIG" -a -r "$FAKE_CTDB_EXTRA_CONFIG" ] ; then
- . "$FAKE_CTDB_EXTRA_CONFIG"
-fi
setup_tunable_config ()
{
- _t="${EVENTSCRIPTS_TESTS_VAR_DIR}/fake-tunable-config.sh"
- export FAKE_CTDB_EXTRA_CONFIG="$_t"
- rm -f "$FAKE_CTDB_EXTRA_CONFIG"
-
- while read line ; do
- case "$line" in
- \#*|"") : ;;
- *) echo "CTDB_SET_${line}"
- esac
- done >"$FAKE_CTDB_EXTRA_CONFIG"
+ cat >"${CTDB_BASE}/ctdb.tunables"
}
result_filter ()