From 3b0d9b2c4dd6590b16fd95c101b8d886b2bda403 Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Mon, 23 Dec 2013 21:44:38 +0100 Subject: [PATCH] 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 --- src/stop.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -- 2.47.3