]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
wait for ctdbd to finish cleanup before considering "service ctdb stop" to be done
authorAndrew Tridgell <tridge@samba.org>
Thu, 13 Sep 2007 23:25:11 +0000 (09:25 +1000)
committerAndrew Tridgell <tridge@samba.org>
Thu, 13 Sep 2007 23:25:11 +0000 (09:25 +1000)
(This used to be ctdb commit 216eb4be7ec481cfe9aaeeada257b77cb394d2e4)

ctdb/config/ctdb.init

index 4f8b61b7bc0887b88a62463d1f0b6eabf4370cad..12443c0a1fac3f03004ed417dae4be06b5bb4502 100755 (executable)
@@ -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