-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass NOTIFY_SOCKET and LISTEN_FDS env to OCI RUntime if set #271
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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") | ||
}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Anyway to work up a test for LISTEN_FDS? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You would have to open a socket, and then set the flags, I guess. Maybe this is something we could do in the test suite. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @TomSweeneyRedHat Actually looking at this deeper, it is very difficult to create a test for this, but doing so I found other issues. Conmon needs to setup LISTEN_PID correctly for this to work. I think we should merge this and then attempt to setup a manual test in systemd to make sure it all works. The way this is supposed to work is systemd will create a process, then will set the LISTEN_FDS=#PASSED in FDS and a LISTEN_PID which is equal to the PID that podman WILL execute with. At which point systemd execs podman. PODMAN then needs to pass these variables down to conmon. Getting podman to run with the correct LISTEN_PID, is something we could work with in the future, not sure how easy that would be to do with GOLANG. Much easier with bash or C. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When I replied earlier I was trying to think of a way to test it, but couldn't concoct one off the top of my head. Chicken and egg thing. Thanks for taking a look into it and I'm glad you found some things that should be chased due to that investigation. |
||
|
||
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"}) | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to make this conditional at all, or is it OK if libpod does this in CRI-O as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any reason to make this conditional. It will not cause any issue. All that happens if the NOTIFY_SOCKET environment is set, is the app will attempt to write to the socket to tell systemd that it is up and ready to receive packets.