From 6961dce08b2488fa6eb08c3532f68c3a2671866a Mon Sep 17 00:00:00 2001 From: Lars Karlitski Date: Fri, 1 Feb 2019 16:46:50 +0100 Subject: [PATCH] installer: Run anaconda in a mount and pid namespace Anaconda can leave child processes and mounts around when it crashes or is canceled before finishing. It also sometimes unmounts unrelated file systems (https://github.com/rhinstaller/anaconda/issues/1791). Run it in a mount and pid namespace to clean up after it. --- src/pylorax/installer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pylorax/installer.py b/src/pylorax/installer.py index 6d101609..a708f742 100644 --- a/src/pylorax/installer.py +++ b/src/pylorax/installer.py @@ -382,7 +382,8 @@ def novirt_install(opts, disk_img, disk_size, cancel_func=None): # Make sure anaconda has the right product and release log.info("Running anaconda.") try: - for line in execReadlines("anaconda", args, reset_lang=False, + unshare_args = [ "--pid", "--kill-child", "--mount", "--propagation", "unchanged", "anaconda" ] + args + for line in execReadlines("unshare", unshare_args, reset_lang=False, env_add={"ANACONDA_PRODUCTNAME": opts.project, "ANACONDA_PRODUCTVERSION": opts.releasever}, callback=lambda p: not novirt_cancel_check(cancel_funcs, p)):