Rev 698: make sure vars are set at startup before recovery in http://samba.org/~tridge/ctdb

tridge at samba.org tridge at samba.org
Fri Jan 4 01:41:55 GMT 2008


------------------------------------------------------------
revno: 698
revision-id:tridge at samba.org-20080104014153-rnrgmot9n0t4a6fu
parent: tridge at samba.org-20080104011202-8236ox1e39q8irrf
committer: Andrew Tridgell <tridge at samba.org>
branch nick: tridge.kantana
timestamp: Fri 2008-01-04 12:41:53 +1100
message:
  make sure vars are set at startup before recovery
modified:
  config/ctdb.init               ctdb.init-20070527204758-biuh7znabuwan3zn-6
=== modified file 'config/ctdb.init'
--- a/config/ctdb.init	2007-10-09 23:42:32 +0000
+++ b/config/ctdb.init	2008-01-04 01:41:53 +0000
@@ -80,19 +80,30 @@
 	    suse)
 		startproc /usr/sbin/ctdbd $CTDB_OPTIONS
 		rc_status -v
+		RETVAL=$?
 		;;
 	    redhat)
 		daemon ctdbd $CTDB_OPTIONS
 		RETVAL=$?
 		echo
 		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/ctdb || RETVAL=1
-		return $RETVAL
 		;;
 	    ubuntu)
 		start-stop-daemon --start --quiet --background --exec /usr/sbin/ctdbd -- $CTDB_OPTIONS
-		return $?
+		RETVAL=$?
 		;;
 	esac
+
+	sleep 1
+	# set any tunables from the config file
+	set | grep ^CTDB_SET_ | cut -d_ -f3- | 
+	while read v; do
+	    varname=`echo $v | cut -d= -f1`
+	    value=`echo $v | cut -d= -f2`
+	    ctdb setvar $varname $value || RETVAL=1
+	done || exit 1
+
+	return $RETVAL
 }	
 
 stop() {



More information about the samba-cvs mailing list