[SCM] CTDB repository - branch 1.2-nodeflags updated - ctdb-1.9.1-262-g6a555eb

Ronnie Sahlberg sahlberg at samba.org
Tue Dec 21 16:55:54 MST 2010


The branch, 1.2-nodeflags has been updated
       via  6a555eb87fe68276dd5e02e5cc0555fb0bbcc2fa (commit)
       via  fd7f61a119b14558ed085de7dedf995020e98779 (commit)
       via  548b787a0512d7d361898569a087eaa5710d69e6 (commit)
      from  6c81496ab2a35fe3f83d2e314283d2023a7fcb78 (commit)

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


- Log -----------------------------------------------------------------
commit 6a555eb87fe68276dd5e02e5cc0555fb0bbcc2fa
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Wed Dec 22 10:27:53 2010 +1100

    41.HTTPD
    
    Httpd can be very slow to start on some platforms,
    wait 5 monitor intervals before we try to restart it if
    it has not bound to port 80 yet.
    After 10 failed intervals, flag the node as unhealthy.

commit fd7f61a119b14558ed085de7dedf995020e98779
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Wed Dec 22 10:09:35 2010 +1100

    60.nfs
    
    Try to restart LOCKD after 10 failures and
    flag the node as unhealthy after 15 failures

commit 548b787a0512d7d361898569a087eaa5710d69e6
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Wed Dec 22 10:05:40 2010 +1100

    Dont run net serverid wipe in the background

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

Summary of changes:
 config/events.d/41.httpd |   21 +++++++++++++++++----
 config/events.d/50.samba |    2 +-
 config/events.d/60.nfs   |   29 +++++++++++++++++++++++------
 3 files changed, 41 insertions(+), 11 deletions(-)


Changeset truncated at 500 lines:

diff --git a/config/events.d/41.httpd b/config/events.d/41.httpd
index 15a35ea..e94bde3 100755
--- a/config/events.d/41.httpd
+++ b/config/events.d/41.httpd
@@ -52,10 +52,23 @@ case "$1" in
 	    exit 0
 	fi
 
-	if ! ctdb_check_tcp_ports 80 ; then
-	    echo "HTTPD is not running. Trying to restart HTTPD."
-	    ctdb_service_start
-	    exit 1
+	if ctdb_check_tcp_ports 80 >/dev/null 2>/dev/null ; then
+	    ctdb_counter_init
+	else
+	    ctdb_counter_incr
+
+	    ctdb_check_counter_equal 5 || {
+		echo "HTTPD is not running. Trying to restart HTTPD."
+		ctdb_service_stop
+		ctdb_service_start
+		exit 0
+	    }
+            ctdb_check_counter_limit 10 quiet|| {
+		echo "HTTPD is not running. Trying to restart HTTPD."
+		ctdb_service_stop
+		ctdb_service_start
+		exit 1
+	    }
 	fi
 	;;
 
diff --git a/config/events.d/50.samba b/config/events.d/50.samba
index c4637c0..a1f99fb 100755
--- a/config/events.d/50.samba
+++ b/config/events.d/50.samba
@@ -72,7 +72,7 @@ start_samba() {
 	# the number of smbd processes will mean that it leaves few cycles for
 	# anything else
 	[ "$CTDB_MANAGES_SAMBA" = "yes" ] && {
-		/usr/bin/net serverid wipe &
+		/usr/bin/net serverid wipe
 
 		nice_service "$CTDB_SERVICE_NMB" start
 		nice_service "$CTDB_SERVICE_SMB" start
diff --git a/config/events.d/60.nfs b/config/events.d/60.nfs
index a8fe243..87955df 100755
--- a/config/events.d/60.nfs
+++ b/config/events.d/60.nfs
@@ -107,12 +107,29 @@ case "$1" in
 	} || exit $?
 
 	# check that lockd responds to rpc requests
-	ctdb_check_rpc "LOCKD" 100021 1 || {
-		echo "Trying to restart lock manager service"
-		startstop_nfs restart
-		startstop_nfslock restart
-		exit 1
-	}
+	if ctdb_check_rpc "LOCKD" 100021 1 >/dev/null ; then
+		(service_name="lockd"; ctdb_counter_init)
+	else
+		(
+			service_name="lockd"
+			ctdb_counter_incr
+
+			ctdb_check_counter_equal 10 || {
+				echo "Trying to restart NFS lock service"
+				startstop_nfs restart >/dev/null 2>&1 &
+				startstop_nfslock restart  >/dev/null 2>&1 &
+				exit 0
+			}
+
+			ctdb_check_counter_limit 15 quiet >/dev/null
+	) || {
+			echo "$ctdb_check_rpc_out"
+			echo "Trying to restart NFS lock service"
+			startstop_nfs restart
+			startstop_nfslock restart
+			exit 1
+		}
+	fi
 
 	# mount needs special handling since it is sometimes not started
 	# correctly on RHEL5


-- 
CTDB repository


More information about the samba-cvs mailing list