From 43bd294446c7a8cfaff1568ba8b088caf1666c43 Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Wed, 10 Oct 2018 15:52:55 -0700 Subject: [PATCH] integration: add setsid for sigterm Signed-off-by: Tonis Tiigi --- util/testutil/integration/oci.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/util/testutil/integration/oci.go b/util/testutil/integration/oci.go index cd25cdc7..a22af372 100644 --- a/util/testutil/integration/oci.go +++ b/util/testutil/integration/oci.go @@ -9,6 +9,7 @@ import ( "os/exec" "path/filepath" "runtime" + "syscall" "testing" "time" @@ -172,6 +173,9 @@ func runBuildkitd(args []string, logs map[string]*bytes.Buffer, uid, gid int) (a args = append(args, "--root", tmpdir, "--addr", address, "--debug") cmd := exec.Command(args[0], args[1:]...) cmd.Env = append(os.Environ(), "BUILDKIT_DEBUG_EXEC_OUTPUT=1") + cmd.SysProcAttr = &syscall.SysProcAttr{ + Setsid: true, // stretch sudo needs this for sigterm + } if stop, err := startCmd(cmd, logs); err != nil { return "", nil, err