From 18a4f0c2149da590608c4851c0f726e6d140ca31 Mon Sep 17 00:00:00 2001 From: Ayush Ranjan Date: Wed, 3 May 2023 19:53:38 -0700 Subject: [PATCH] Avoid duplicate --attached flag when re-exec-ing boot process. Some parameters are not already part of os.Args because they are solely configured by Boot.Execute(). These need to be manually added in Boot.prepareArgs(). But --attached is *not* one of these parameters. It is not configured by boot process, it is configured by invokers of boot process. PiperOrigin-RevId: 529264276 --- runsc/cmd/boot.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/runsc/cmd/boot.go b/runsc/cmd/boot.go index 153d539e1..46eec33db 100644 --- a/runsc/cmd/boot.go +++ b/runsc/cmd/boot.go @@ -452,14 +452,10 @@ func (b *Boot) prepareArgs(exclude ...string) []string { } } args = append(args, arg) - // Strategically add parameters after the command and before the container - // ID at the end. + // Some parameters are not already part of os.Args because they are + // solely configured by Boot.Execute(). Strategically add these parameters + // after the command and before the container ID at the end. if arg == "boot" { - if b.attached { - // This is needed to ensure the new process is killed when the parent - // process terminates. - args = append(args, "--attached") - } if b.procMountSyncFD != -1 { args = append(args, fmt.Sprintf("--proc-mount-sync-fd=%d", b.procMountSyncFD)) }