build_ctdb_options ()
{
+ ctdb_options=""
maybe_set ()
{
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
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"
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=""
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}" $*
{
local ctdb_options="$*"
- # We really just want to pass CTDB_OPTIONS but on RH
- # /etc/sysconfig/ctdb can, and frequently does, set that variable.
- # So instead, we hack badly. We'll add these as we use them.
- # Note that these may still be overridden by the above file... but
- # we tend to use the exotic options here... so that is unlikely.
-
case "$ctdb_options" in
*--start-as-stopped*)
export CTDB_START_AS_STOPPED="yes"