[SCM] CTDB repository - branch master updated - ctdb-1.0.113-65-g522fbb0
Ronnie Sahlberg
sahlberg at samba.org
Thu Jan 21 21:35:12 MST 2010
The branch, master has been updated
via 522fbb012524fe41a67dbe43589a282dda6bcbe2 (commit)
from 60aa570aaa77d293b963105b3f605f9625a4594b (commit)
http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 522fbb012524fe41a67dbe43589a282dda6bcbe2
Author: Martin Schwenke <martin at meltin.net>
Date: Fri Jan 22 13:19:00 2010 +1100
initscript: handle spaces in option values inserted into $CTDB_OPTIONS.
This puts single quotes around everything and uses eval on the
command-lines that actually start ctdbd. The eval causes the single
quotes to be interpreted.
The "redhat" init style no longer uses the Red Hat daemon function.
It loses the quoting and re-splits on spaces. Instead we add an extra
line that uses the success/failure functions to keep things pretty.
Note that this means that we don't respect daemon's
$DAEMON_COREFILE_LIMIT variable but we do our own core file handling
with $CTDB_SUPPRESS_COREFILE anyway. daemon's core file handling was
probably overriding what we were doing anyway, so this can be regarded
as a bug fix.
Signed-off-by: Martin Schwenke <martin at meltin.net>
-----------------------------------------------------------------------
Summary of changes:
config/ctdb.init | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
Changeset truncated at 500 lines:
diff --git a/config/ctdb.init b/config/ctdb.init
index 96ffb1e..b4df177 100755
--- a/config/ctdb.init
+++ b/config/ctdb.init
@@ -65,7 +65,7 @@ build_ctdb_options () {
# then return
[ -z "$2" -o \( -n "$3" -a "$3" != "$2" \) ] && return
- val="$2"
+ val="'$2'"
case "$1" in
--*) sep="=" ;;
-*) sep=" " ;;
@@ -186,25 +186,26 @@ start() {
case $init_style in
valgrind)
- valgrind -q --log-file=/var/log/ctdb_valgrind \
- $ctdbd --valgrinding $CTDB_OPTIONS
+ eval valgrind -q --log-file=/var/log/ctdb_valgrind \
+ $ctdbd --valgrinding "$CTDB_OPTIONS"
RETVAL=$?
echo
;;
suse)
- startproc $ctdbd $CTDB_OPTIONS
+ eval startproc $ctdbd "$CTDB_OPTIONS"
rc_status -v
RETVAL=$?
;;
redhat)
- daemon $ctdbd $CTDB_OPTIONS
+ eval $ctdbd "$CTDB_OPTIONS"
RETVAL=$?
+ [ $RETVAL -eq 0 ] && success || failure
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/ctdb || RETVAL=1
;;
debian)
- start-stop-daemon --start --quiet --background \
- --exec $ctdbd -- $CTDB_OPTIONS
+ eval start-stop-daemon --start --quiet --background \
+ --exec $ctdbd -- "$CTDB_OPTIONS"
RETVAL=$?
;;
esac
--
CTDB repository
More information about the samba-cvs
mailing list