Unmount with plain umount and a lazy fallback, cover the chroot API #1
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Keel-Linux/turnkey-chroot!1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/umount-in-lxc"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem: inside an LXC container (TKLDev as a Proxmox CT) every fab-chroot raised MountError at the end of the build and left proc and dev/pts mounted under build/root.patched; the next stage ran mksquashfs over the tree, descended into the host's /proc and hung indefinitely.
Diagnosis: MagicMounts.umount() ran
umount --force, which the container kernel refuses for proc ("block devices are not permitted on filesystem"). The flag only matters for unreachable network filesystems, which these never are.Fix: plain
umount, retry with--lazywhen that fails (busy mount), MountError only when both fail. The tests gained the mount loop (--type and --bind profiles, already-mounted skips, both MountError paths), the devpts before dev ordering on umount, del, both repr methods, Chroot.system and Chroot.run argv construction, the environ defaults and the log level read from the environment. Everything runs with subprocess.run patched: no root, no real mounts. The 95 percent coverage threshold and the test commands are committed (pyproject.toml, README.md).Tests: 40 pytest, 100 percent lines and branches with
coverage run --branch --source=chroot,coverage report --fail-under=95passes. Behaviour checked in an LXC container (was: MountError and 2 mounts left; now clean, 0 left) and on a KVM virtual machine (unchanged: clean).Serves BRIEF section 4 (the build host runs as an LXC container) and section 10 (system containers only).