From 989f5e30627eb90a66fa06f87c40d161476395ed Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Sun, 4 Feb 2018 07:29:47 -0500 Subject: Pass NOTIFY_SOCKET and LISTEN_FDS env to OCI RUntime if set In order to have sd_notify from systemd to work in containers we need to pass down the NOTIFY_SOCKET environment variable to the container. LISTEN_FDS, tells the application inside of the container to use socket activation and grab the FDS that are leaked into the container. Signed-off-by: Daniel J Walsh Closes: #271 Approved by: umohnani8 --- test/e2e/run_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test') diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go index f364b6952..7bd42edc4 100644 --- a/test/e2e/run_test.go +++ b/test/e2e/run_test.go @@ -185,6 +185,17 @@ var _ = Describe("Podman run", func() { Expect(session.OutputToString()).To(ContainSubstring("15")) }) + It("podman run notify_socket", func() { + sock := "/run/sock" + os.Setenv("NOTIFY_SOCKET", sock) + session := podmanTest.Podman([]string{"run", "--rm", ALPINE, "printenv", "NOTIFY_SOCKET"}) + session.Wait(10) + Expect(session.ExitCode()).To(Equal(0)) + match, _ := session.GrepString(sock) + Expect(match).Should(BeTrue()) + os.Unsetenv("NOTIFY_SOCKET") + }) + It("podman run log-opt", func() { log := filepath.Join(podmanTest.TempDir, "/container.log") session := podmanTest.Podman([]string{"run", "--rm", "--log-opt", fmt.Sprintf("path=%s", log), ALPINE, "ls"}) -- cgit v1.2.3-54-g00ecf