From: Andrew Tridgell Date: Thu, 13 Sep 2007 23:25:11 +0000 (+1000) Subject: wait for ctdbd to finish cleanup before considering "service ctdb stop" to be done X-Git-Tag: tevent-0.9.20~348^2~2408 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3b159e4e60a68ac0ee9a8d053c7b1548df56c73c;p=thirdparty%2Fsamba.git wait for ctdbd to finish cleanup before considering "service ctdb stop" to be done (This used to be ctdb commit 216eb4be7ec481cfe9aaeeada257b77cb394d2e4) --- diff --git a/ctdb/config/ctdb.init b/ctdb/config/ctdb.init index 4f8b61b7bc0..12443c0a1fa 100755 --- a/ctdb/config/ctdb.init +++ b/ctdb/config/ctdb.init @@ -92,12 +92,17 @@ start() { 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 - sleep 1 - killall -q -9 ctdbd - } RETVAL=$? + count=0 + while killall -q -0 ctdbd; do + sleep 1 + 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