[SCM] CTDB repository - branch master updated - ctdb-1.0.84-23-g16ec9ca

Ronnie Sahlberg sahlberg at samba.org
Tue Jun 23 01:02:21 GMT 2009


The branch, master has been updated
       via  16ec9ca56a9f5b88d7a5ed4f89a28a53f5c9c081 (commit)
       via  867f57d166395c92949e480ca725249b0ca8950b (commit)
       via  070305adfe636c2580776e6bf24bb8be06622b86 (commit)
      from  fc69b6a66282d5be6edeb286bf72aeafb252e6dd (commit)

http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 16ec9ca56a9f5b88d7a5ed4f89a28a53f5c9c081
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Tue Jun 23 11:01:04 2009 +1000

    rename 99.routing to 11.routing so the eventscript is processed before
    NFS and LVS

commit 867f57d166395c92949e480ca725249b0ca8950b
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Jun 2 15:54:04 2009 +1000

    Fix minor problem in previous initscript commit.
    
    The valgrind start case should not use daemon, since this is specific
    to Red Hat.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit 070305adfe636c2580776e6bf24bb8be06622b86
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Jun 2 10:01:50 2009 +1000

    Initscript fixes, mostly for "stop" action.
    
    Use a local variable $ctdbd so that we always run ctdbd from the the
    same place and so that we know what to kill.  This variable respects
    the $CTDBD environment variable, which may be used to specify an
    alternative location for the daemon.
    
    In the important cases use "pkill -0 -f" to check if ctdbd is
    running.  Also, remove the special case for killing ctdbd when running
    under valgrind.  The regular case will handle this just fine.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

-----------------------------------------------------------------------

Summary of changes:
 config/ctdb.init                           |   27 +++++++++++++--------------
 config/events.d/{99.routing => 11.routing} |    0 
 2 files changed, 13 insertions(+), 14 deletions(-)
 rename config/events.d/{99.routing => 11.routing} (100%)


Changeset truncated at 500 lines:

diff --git a/config/ctdb.init b/config/ctdb.init
index 5cf13ac..4076c5b 100755
--- a/config/ctdb.init
+++ b/config/ctdb.init
@@ -93,6 +93,8 @@ set_retval() {
 	return $1
 }
 
+ctdbd=${CTDBD:-/usr/sbin/ctdbd}
+
 start() {
 	echo -n $"Starting ctdbd service: "
 
@@ -118,22 +120,24 @@ start() {
 
 	case $init_style in
 	    valgrind)
-		valgrind -q --log-file=/var/log/ctdb_valgrind /usr/sbin/ctdbd --nosetsched $CTDB_OPTIONS 
+		valgrind -q --log-file=/var/log/ctdb_valgrind \
+		    $ctdbd --nosetsched $CTDB_OPTIONS 
 		RETVAL=0
 		;;
 	    suse)
-		startproc /usr/sbin/ctdbd $CTDB_OPTIONS
+		startproc $ctdbd $CTDB_OPTIONS
 		rc_status -v
 		RETVAL=$?
 		;;
 	    redhat)
-		daemon ctdbd $CTDB_OPTIONS
+		daemon $ctdbd $CTDB_OPTIONS
 		RETVAL=$?
 		echo
 		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/ctdb || RETVAL=1
 		;;
 	    ubuntu)
-		start-stop-daemon --start --quiet --background --exec /usr/sbin/ctdbd -- $CTDB_OPTIONS
+		start-stop-daemon --start --quiet --background \
+		    --exec $ctdbd -- $CTDB_OPTIONS
 		RETVAL=$?
 		;;
 	esac
@@ -152,7 +156,7 @@ start() {
 
 stop() {
 	echo -n $"Shutting down ctdbd service: "
-	ctdb ping >& /dev/null || {
+	pkill -0 -f $ctdbd || {
 	    echo -n "  Warning: ctdbd not running ! "
 	    case $init_style in
 		suse)
@@ -164,20 +168,15 @@ stop() {
 	    esac
 	    return 0
 	}
-	ctdb shutdown
+	ctdb shutdown >/dev/null 2>&1
 	RETVAL=$?
 	count=0
-	if [ "$init_style" = "valgrind" ]; then
-	    # very crude method
-	    sleep 2
-	    pkill -9 -f valgrind
-	fi
-	while killall -q -0 ctdbd; do
+	while pkill -0 -f $ctdbd ; do
 	    sleep 1
-	    count=`expr $count + 1`
+	    count=$(($count + 1))
 	    [ $count -gt 10 ] && {
 		echo -n $"killing ctdbd "
-		killall -q -9 ctdbd
+		pkill -9 -f $ctdbd
 		pkill -9 -f $CTDB_BASE/events.d/
 	    }
 	done
diff --git a/config/events.d/99.routing b/config/events.d/11.routing
similarity index 100%
rename from config/events.d/99.routing
rename to config/events.d/11.routing


-- 
CTDB repository


More information about the samba-cvs mailing list