umount without sleep, as umount -l detaches inmediately
This commit is contained in:
parent
46a69d58e7
commit
c2065454b4
16
common
16
common
@ -39,22 +39,10 @@ chroot_setup() {
|
||||
|
||||
chroot_teardown() {
|
||||
if (( ${#CHROOT_ACTIVE_MOUNTS[@]} )); then
|
||||
local mount
|
||||
local attempt
|
||||
|
||||
umount -l "${CHROOT_ACTIVE_MOUNTS[@]}"
|
||||
|
||||
for mount in "${CHROOT_ACTIVE_MOUNTS[@]}"; do
|
||||
attempt=1
|
||||
|
||||
while grep --quiet "${mount}" "/proc/mounts" && [[ "${attempt}" -le 50 ]]; do
|
||||
sleep 0.1
|
||||
attempt="$((attempt + 1))"
|
||||
done
|
||||
done
|
||||
|
||||
unset CHROOT_ACTIVE_MOUNTS
|
||||
fi
|
||||
|
||||
unset CHROOT_ACTIVE_MOUNTS
|
||||
}
|
||||
|
||||
chroot_add_mount_lazy() {
|
||||
|
Loading…
Reference in New Issue
Block a user