From: Loic Dachary Date: Mon, 23 Dec 2013 20:44:38 +0000 (+0100) Subject: vstart/stop: do not loop forever on kill X-Git-Tag: v0.75~41^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F991%2Fhead;p=ceph.git vstart/stop: do not loop forever on kill 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 --- diff --git a/src/stop.sh b/src/stop.sh index 4891336502bc..1a498ba8f954 100755 --- a/src/stop.sh +++ b/src/stop.sh @@ -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