From: Daan De Meyer Date: Sat, 6 Jul 2024 19:49:19 +0000 (+0200) Subject: run: Don't try to communicate inner pid for debug shell X-Git-Tag: v24~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=588ee48ff5e8ae17c8c5ab0c4d802e9d611941ba;p=thirdparty%2Fmkosi.git run: Don't try to communicate inner pid for debug shell The pipe write end has already been closed by then so bash will fail with "bad file descriptor". Since there's no reason in having the inner pid in the debug shell let's make sure we don't try to communicate it there. --- diff --git a/mkosi/run.py b/mkosi/run.py index e5ba10f2b..9d865ba7a 100644 --- a/mkosi/run.py +++ b/mkosi/run.py @@ -296,13 +296,14 @@ def spawn( os.close(w) w = q # dash doesn't support working with file descriptors higher than 9 so make sure we use bash. - prefix += ["bash", "-c", f"echo $$ >&{w} && exec {w}>&- && exec $0 \"$@\""] + innerpidcmd = ["bash", "-c", f"echo $$ >&{w} && exec {w}>&- && exec $0 \"$@\""] else: + innerpidcmd = [] r, w = (None, None) try: with subprocess.Popen( - [*scope, *prefix, *cmdline], + [*scope, *prefix, *innerpidcmd, *cmdline], stdin=stdin, stdout=stdout, stderr=stderr,