Exiting catalyst with Ctrl-C (SIGINT/SIGTERM) fails to clean up bind mounts from chroot (exit fails hard, rather than cleaning up, eg. when emerge fails) ---- Exiting on signal Signals.SIGINT (chroot) wand_MJE ~/catalyst # SIGINT signal recieved killing ./tmp/stage1-chroot.sh with pid 12811 /usr/share/catalyst/targets/support/functions.sh: line 19: 12811 Killed ${clst_CHROOT} ${chroot_path} .${destdir}/${file_name}
commit 488b06bf5dbe1eba68ac11de95f56feeb6cead83 Author: Matt Turner <mattst88@gentoo.org> Date: Thu Oct 29 11:00:42 2020 -0400 catalyst: Run the build sequence in new mount namespace Catalyst has a lot of code to unmount the bind mounts it's made, and then more to try harder when something fails. This is important because if bind mounts still exist within the chroot when clean up happens, files outside of the chroot on the host system can inadvertently be deleted. E.g., distfiles, binpkgs, kerncache. Running the build sequence (the steps that need bind mounts) within a mount namespace and exiting the mount namespace when finished ensures that clean up can never accidentally delete files outside the chroot. Signed-off-by: Matt Turner <mattst88@gentoo.org>