Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 655924

Summary: Exiting catalyst with Ctrl-C (SIGINT/SIGTERM) fails to clean up bind mounts from chroot
Product: Gentoo Hosted Projects Reporter: Michael 'veremitz' Everitt <gentoo>
Component: CatalystAssignee: Gentoo Catalyst Developers <catalyst>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Michael 'veremitz' Everitt 2018-05-17 00:20:08 UTC
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}
Comment 1 Matt Turner gentoo-dev 2021-01-26 01:23:57 UTC
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>