summaryrefslogtreecommitdiffstats
path: root/vagrant/provision/assets/build-tails
diff options
context:
space:
mode:
Diffstat (limited to 'vagrant/provision/assets/build-tails')
-rwxr-xr-xvagrant/provision/assets/build-tails8
1 files changed, 7 insertions, 1 deletions
diff --git a/vagrant/provision/assets/build-tails b/vagrant/provision/assets/build-tails
index 23da292..007d204 100755
--- a/vagrant/provision/assets/build-tails
+++ b/vagrant/provision/assets/build-tails
@@ -29,7 +29,13 @@ cleanup() {
remove_build_dirs() {
for mountpoint in $(old_build_dirs | tac) ; do
- sudo umount -f -l "$mountpoint"
+ tries=0
+ sudo lsof | grep --fixed-strings "$mountpoint" || true
+ while ! sudo umount -f --verbose "$mountpoint" && [ $tries -lt 12 ]; do
+ sudo fuser --ismountpoint --mount "$mountpoint" --kill
+ sleep 5
+ tries=$(expr $tries + 1)
+ done
sudo rm -rf "$mountpoint"
done
}