From fe919e4914657d197adfb1be9e6885dbac82d310 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Sat, 10 Nov 2018 21:43:57 +0100 Subject: [PATCH] oci: propagate NOTIFY_SOCKET on runtime start with https://github.com/opencontainers/runc/pull/1807 we moved the systemd notify initialization from "create" to "start", so that the OCI runtime doesn't hang while waiting on reading from the notify socket. This means we also need to set the correct NOTIFY_SOCKET when start'ing the container. Closes: https://github.com/containers/libpod/issues/746 Signed-off-by: Giuseppe Scrivano --- libpod/oci.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libpod/oci.go b/libpod/oci.go index a8013aa474..6ca3ef2e63 100644 --- a/libpod/oci.go +++ b/libpod/oci.go @@ -591,6 +591,9 @@ func (r *OCIRuntime) startContainer(ctr *Container) error { return err } env := []string{fmt.Sprintf("XDG_RUNTIME_DIR=%s", runtimeDir)} + if notify, ok := os.LookupEnv("NOTIFY_SOCKET"); ok { + env = append(env, fmt.Sprintf("NOTIFY_SOCKET=%s", notify)) + } if err := utils.ExecCmdWithStdStreams(os.Stdin, os.Stdout, os.Stderr, env, r.path, "start", ctr.ID()); err != nil { return err }