Rev 623: wait for ctdbd to finish cleanup before considering "service ctdb stop" to be done in http://samba.org/~tridge/ctdb

tridge at samba.org tridge at samba.org
Thu Sep 13 23:25:12 GMT 2007


------------------------------------------------------------
revno: 623
revision-id: tridge at samba.org-20070913232511-gzim7pcd33vy9vyg
parent: tridge at samba.org-20070913232434-9fhk40ayfeqa3316
committer: Andrew Tridgell <tridge at samba.org>
branch nick: tridge.test2
timestamp: Fri 2007-09-14 09:25:11 +1000
message:
  wait for ctdbd to finish cleanup before considering "service ctdb stop" to be done
modified:
  config/ctdb.init               ctdb.init-20070527204758-biuh7znabuwan3zn-6
=== modified file 'config/ctdb.init'
--- a/config/ctdb.init	2007-09-13 04:36:23 +0000
+++ b/config/ctdb.init	2007-09-13 23:25:11 +0000
@@ -92,12 +92,17 @@
 stop() {
 	echo -n $"Shutting down ctdbd service: "
 	ctdb shutdown
-	killall -q -0 ctdbd && {
-	    # if it survived, give it 1 second then kill it with extreme prejudice
+	RETVAL=$?
+	count=0
+	while killall -q -0 ctdbd; do
 	    sleep 1
-	    killall -q -9 ctdbd
-	}
-	RETVAL=$?
+	    count=`expr $count + 1`
+	    [ $count -gt 10 ] && {
+		echo -n $"killing ctdbd "
+		killall -q -9 ctdbd
+		pkill -f -9 /etc/ctdb/events.d/
+	    }
+	done
 	case $init_style in
 	    suse)
 		rc_status -v



More information about the samba-cvs mailing list