From dace30d88583e7e45deaa7116de8bf608db0ef59 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Thu, 10 Sep 2015 12:15:51 +0200 Subject: reproducible: cleanup sessions more carefully --- bin/schroot-create.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'bin/schroot-create.sh') diff --git a/bin/schroot-create.sh b/bin/schroot-create.sh index 51859325..348842c6 100755 --- a/bin/schroot-create.sh +++ b/bin/schroot-create.sh @@ -183,8 +183,15 @@ bootstrap() { cleanup_schroot_sessions() { # FIXME: if this works well, move to _common.sh and use the same function from _maintenance.sh - ps fax|grep -v grep |grep schroot || for i in $(schroot --all-sessions -l ) ; do ps fax|grep -v grep |grep schroot || schroot -e -c $i ; done - schroot --all-sessions -l + local RESULT="" + for loop in $(seq 0 9) ; do + ps fax|grep -v grep |grep schroot || for i in $(schroot --all-sessions -l ) ; do ps fax|grep -v grep |grep schroot || schroot -e -c $i ; done + RESULT=$(schroot --all-sessions -l) + if [ -z "$RESULT" ] ; then + break + fi + sleep 5 + done } cleanup() { -- cgit v1.2.3-54-g00ecf