Rev 411: added CTDB_WAIT_DIRECTORIES support in http://samba.org/~tridge/ctdb

tridge at samba.org tridge at samba.org
Fri Jun 1 03:50:19 GMT 2007


------------------------------------------------------------
revno: 411
revision-id: tridge at samba.org-20070601035018-iqs91hrut48yk8jg
parent: tridge at samba.org-20070601032911-4o9qwds8gfregd3p
committer: Andrew Tridgell <tridge at samba.org>
branch nick: tridge
timestamp: Fri 2007-06-01 13:50:18 +1000
message:
  added CTDB_WAIT_DIRECTORIES support
modified:
  packaging/RHEL/setup/ctdb.sysconfig ctdb.sysconfig-20070527204758-biuh7znabuwan3zn-7
  tools/events                   events-20070529030121-04fjh63cxfh8v1pj-1
=== modified file 'packaging/RHEL/setup/ctdb.sysconfig'
--- a/packaging/RHEL/setup/ctdb.sysconfig	2007-05-31 01:09:45 +0000
+++ b/packaging/RHEL/setup/ctdb.sysconfig	2007-06-01 03:50:18 +0000
@@ -47,6 +47,11 @@
 # the default is not to wait for any local services
 # CTDB_WAIT_TCP_PORTS="445 139"
 
+# use this to specify any local directories to wait on before starting
+# ctdb. You should list any critical Samba or NFS shared directories 
+# the default is not to wait for any local directories
+# CTDB_WAIT_DIRECTORIES="/some/directory"
+
 # the shared directory where you want to put statd information on
 # which clients to notify on a NFS restart
 # there is no default

=== modified file 'tools/events'
--- a/tools/events	2007-06-01 03:26:14 +0000
+++ b/tools/events	2007-06-01 03:50:18 +0000
@@ -8,10 +8,10 @@
 
 case $cmd in 
      startup)
-	# wait for local services to come up
+	# wait for local services to come up.
 	[ -z "$CTDB_WAIT_TCP_PORTS" ] || {
 	  all_ok=0
-	  echo "Waiting for tcp services on $CTDB_WAIT_TCP_PORTS to come up"
+	  echo "Waiting for local tcp ports $CTDB_WAIT_TCP_PORTS"
 	  while [ $all_ok -eq 0 ]; do
 	  	  all_ok=1
 	  	  for p in $CTDB_WAIT_TCP_PORTS; do
@@ -23,7 +23,24 @@
 			exit 1
 		  }
           done
-	  echo "Local tcp services on $CTDB_WAIT_TCP_PORTS are up"
+	  echo "Local tcp services are up"
+	}
+	# wait for local directories to becomes available (could be slow to mount)
+	[ -z "$CTDB_WAIT_DIRECTORIES" ] || {
+	  all_ok=0
+	  echo "Waiting for local directories $CTDB_WAIT_DIRECTORIES"
+	  while [ $all_ok -eq 0 ]; do
+	  	  all_ok=1
+	  	  for d in $CTDB_WAIT_DIRECTORIES; do
+	  	      [ -d $d ] || all_ok=0
+		  done
+		  [ $all_ok -eq 1 ] || sleep 1
+		  /usr/bin/ctdb status > /dev/null 2>&1 || {
+	  		echo "ctdb daemon has died. Exiting event startup"
+			exit 1
+		  }
+          done
+	  echo "Local directories are available"
 	}
 	exit 0;	
 	;;



More information about the samba-cvs mailing list