Package: pbuilder
Version: 0.231
Severity: wishlist
X-Debbugs-Cc: [email protected]
Hi
When using cowbuilder --login with a bindmount, I occasionally hit a
problem where umounting fails on exiting from the chroot.
Here, pbuilder/cowbuilder as a precaution aborts the exit and forces you
to solve the problem to avoid trashing your files. This is great.
In my case, I cannot always figure out why the mount point refuses to
unmount but a lazy unmount (umount -l) gets the job done enough that my
files are no longer in danger. Doing that causes pbuilder to still fail
on exit now with:
umount: /var/cache/pbuilder/build/cow.XXX/path/to/mp: not mounted.
And then throws me back into the chroot. So, to "unstuck" this, I end up
having first to umount the mountpoint manually and then manually remount
something else at that mountpoint, so pbuilder/cowbuilder get continue.
I think it would be nice if pbuilder could test if the mountpoint is
still a mountpoint. Since `mountpoint` is in `util-linux` (Essential:
yes), this could be done with:
IS_MOUNTED=true
mountpoint -q "$MP" || RC=$?
if [ "${RC}" = "32" ]; then
IS_MOUNTED=false
fi
For safety, I would recommend always doing umount, if that fails but
mountpoint says the path is not a mountpoint, then it can progress.
Best regards,
Niels