summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2018-11-10 21:43:57 +0100
committerGiuseppe Scrivano <gscrivan@redhat.com>2018-11-28 16:25:12 +0100
commitfe919e4914657d197adfb1be9e6885dbac82d310 (patch)
tree694c7326c87112e6c321b6c68c292ab9cd849c71
parentf7d972a70f91a85a5630186e448e7012dc0b8c53 (diff)
downloadpodman-fe919e4914657d197adfb1be9e6885dbac82d310.tar.gz
podman-fe919e4914657d197adfb1be9e6885dbac82d310.tar.bz2
podman-fe919e4914657d197adfb1be9e6885dbac82d310.zip
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 <gscrivan@redhat.com>
-rw-r--r--libpod/oci.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/libpod/oci.go b/libpod/oci.go
index a8013aa47..6ca3ef2e6 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
}