summaryrefslogtreecommitdiffstats
path: root/ctdb/config
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2013-10-15 11:54:58 +1100
committerAmitay Isaacs <amitay@gmail.com>2013-10-22 14:34:04 +1100
commit4526fdbbca4fbadc53ec354ceca7cc59ba3a31b6 (patch)
tree0546311c4810f2bc10f6be5f5379764a480d1142 /ctdb/config
parent1043b53d12c466010a4a70c5edbc3e3d91a1ba06 (diff)
downloadsamba-4526fdbbca4fbadc53ec354ceca7cc59ba3a31b6.tar.gz
samba-4526fdbbca4fbadc53ec354ceca7cc59ba3a31b6.tar.xz
samba-4526fdbbca4fbadc53ec354ceca7cc59ba3a31b6.zip
scripts: Remove support for CTDB_OPTIONS configuration variable
Allowing people to put random options in CTDB_OPTIONS complicates some logic (particularly around use of syslog). If we're going to have variables for options then let's make sure we have a variable for each option and make people use them. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit e55f3a1577eff0182802b0341d865d961aeae1c7)
Diffstat (limited to 'ctdb/config')
-rw-r--r--ctdb/config/ctdb.sysconfig4
-rwxr-xr-xctdb/config/ctdbd_wrapper19
-rwxr-xr-xctdb/config/functions3
3 files changed, 8 insertions, 18 deletions
diff --git a/ctdb/config/ctdb.sysconfig b/ctdb/config/ctdb.sysconfig
index 6b7af67f64..8233f27a96 100644
--- a/ctdb/config/ctdb.sysconfig
+++ b/ctdb/config/ctdb.sysconfig
@@ -334,7 +334,3 @@ CTDB_SERVICE_AUTOSTARTSTOP=yes
# 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/ctdbd_wrapper b/ctdb/config/ctdbd_wrapper
index fbc76cf78f..259cfe46ea 100755
--- a/ctdb/config/ctdbd_wrapper
+++ b/ctdb/config/ctdbd_wrapper
@@ -79,6 +79,7 @@ ctdbd_is_running ()
build_ctdb_options ()
{
+ ctdb_options=""
maybe_set ()
{
@@ -99,7 +100,7 @@ build_ctdb_options ()
sep=""
fi
- CTDB_OPTIONS="${CTDB_OPTIONS}${CTDB_OPTIONS:+ }${1}${sep}${val}"
+ ctdb_options="${ctdb_options}${ctdb_options:+ }${1}${sep}${val}"
}
if [ -z "$CTDB_RECOVERY_LOCK" ] ; then
@@ -109,7 +110,7 @@ build_ctdb_options ()
maybe_set "--pidfile" "$pidfile"
- # build up CTDB_OPTIONS variable from optional parameters
+ # build up ctdb_options variable from optional parameters
maybe_set "--logfile" "$CTDB_LOGFILE"
maybe_set "--nlist" "$CTDB_NODES"
maybe_set "--socket" "$CTDB_SOCKET"
@@ -181,18 +182,14 @@ start()
else
ctdbd="${CTDB_VALGRIND} ${ctdbd}"
fi
- CTDB_OPTIONS="${CTDB_OPTIONS} --valgrinding"
+ ctdb_options="${ctdb_options} --valgrinding"
fi
- # This is ugly but will improve when we get rid of $CTDB_OPTIONS
- # and use only $CTDB_SYSLOG.
- case "$CTDB_OPTIONS" in
- *--syslog*) : ;;
- *)
- logger -t ctdbd "CTDB is being run without syslog enabled. Logs will be in ${CTDB_LOGFILE:-/var/log/log.ctdb}"
- esac
+ if [ "$CTDB_SYSLOG" != "yes" ] ; then
+ logger -t ctdbd "CTDB is being run without syslog enabled. Logs will be in ${CTDB_LOGFILE:-/var/log/log.ctdb}"
+ fi
- eval "$ctdbd" "$CTDB_OPTIONS" || return 1
+ eval "$ctdbd" "$ctdb_options" || return 1
# Wait until ctdbd has started and is ready to respond to clients.
_pid=""
diff --git a/ctdb/config/functions b/ctdb/config/functions
index b22b05e8c9..878174bc54 100755
--- a/ctdb/config/functions
+++ b/ctdb/config/functions
@@ -92,9 +92,6 @@ script_log ()
if [ "$CTDB_SYSLOG" = "yes" -o -z "$CTDB_LOGFILE" ] ; then
_using_syslog=true
fi
- case "$CTDB_OPTIONS" in
- *--syslog*) _using_syslog=true ;;
- esac
if $_using_syslog ; then
logger -t "ctdbd: ${_tag}" $*