diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2012-02-15 19:25:52 +0000 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2012-03-01 12:47:52 +0000 |
commit | 3d8194681f44f1504ce5f374796c0f5d933d4bb7 (patch) | |
tree | b667836e3b91a320ea10b7e9b8b5ac58bd9f8f8c /clone | |
parent | 9d8eed41294b5dbcbdf543511338eb21aa230a7f (diff) | |
download | libguestfs-3d8194681f44f1504ce5f374796c0f5d933d4bb7.tar.gz libguestfs-3d8194681f44f1504ce5f374796c0f5d933d4bb7.tar.xz libguestfs-3d8194681f44f1504ce5f374796c0f5d933d4bb7.zip |
sysprep: Try unmounting the filesystem a few times when busy.
tracker-miner-fs jumps into newly mounted filesystems. This prevents
the filesystem from being unmounted, so retry a few times.
(cherry picked from commit 5fa7aace200a49961173de6316a81e239987c179)
Diffstat (limited to 'clone')
-rw-r--r-- | clone/virt-sysprep.in | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/clone/virt-sysprep.in b/clone/virt-sysprep.in index 9e8f212b..833a31de 100644 --- a/clone/virt-sysprep.in +++ b/clone/virt-sysprep.in @@ -390,7 +390,17 @@ esac sync -fusermount -u $tmpdir/mnt +# Unfortunately various unwanted processes jump into mountpoints. +# tracker-miner-fs is the latest, previously it was something called +# gvfs-gdu-volume-monitor. Therefore if the mountpoint is busy, try +# to unmount it a few times. XXX +count=10 +while ! fusermount -u $tmpdir/mnt && [ $count -gt 0 ]; do + sleep 1 + ((count--)) +done +if [ $count -eq 0 ]; then exit 1; fi + rm -rf $tmpdir trap - EXIT ERR |