]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
vstart/stop: do not loop forever on kill 991/head
authorLoic Dachary <loic@dachary.org>
Mon, 23 Dec 2013 20:44:38 +0000 (21:44 +0100)
committerLoic Dachary <loic@dachary.org>
Mon, 23 Dec 2013 20:44:38 +0000 (21:44 +0100)
It may be the case that stop.sh can't stop a process for reasons
unrelated to vstart.sh. Because apache runs independantly, for
instance. Instead of trying forever, try twice in a raw ( should be
enough 99% of the case ) and try three more times, sleeping one second
between each try should be more than enough.

Signed-off-by: Loic Dachary <loic@dachary.org>
src/stop.sh

index 4891336502bc98cf201c3c589ca087cb603161c5..1a498ba8f9540787fdf029f9b172e5ba89874e7f 100755 (executable)
@@ -58,7 +58,12 @@ done
 
 if [ $stop_all -eq 1 ]; then
        for p in ceph-mon ceph-mds ceph-osd radosgw lt-radosgw apache2 ; do
-            while pkill $p ; do : ; done
+            for try in 0 1 1 1 1 ; do
+                if ! pkill $p ; then
+                    break
+                fi
+                sleep $try
+            done
         done
        pkill -f valgrind.bin.\*ceph-mon
        $SUDO pkill -f valgrind.bin.\*ceph-osd