-
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
Advertise Conmon PID via MAINPID #6689
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: goochjj The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @goochjj. Thanks for your PR. I'm waiting for a containers member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
libpod/oci_conmon_linux.go
Outdated
@@ -37,6 +37,7 @@ import ( | |||
"github.com/sirupsen/logrus" | |||
"golang.org/x/sys/unix" | |||
"k8s.io/client-go/tools/remotecommand" | |||
"github.com/coreos/go-systemd/v22/daemon" |
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.
@goochjj gating doesn't like the location of this line, it needs to move up in alpha order. I think to line 32.5
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.
fixed
Gating is complaining about gofmt. @giuseppe PTAL |
Once gating and happy tests are complete |
80c6c37
to
f4c3779
Compare
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.
This could break existing users. Until now, we deferred all sd notify communication to the container.
The main pid, however, would make sense to communicate as that's not something any process in the container could know.
I'll pass it to @giuseppe :^) |
491e018
to
f4a93ec
Compare
I'm not sure how to fix the vendor check. When I run the go mod commands locally it deletes many many things. |
f4a93ec
to
642da3e
Compare
I think I figured it out |
We require go >= 1.1.3. If you're below that, you can run |
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.
runc already sends a MAINPID=$PID-CONTAINER
, crun doesn't. More in general we are already delegating the sd-notify logic to the OCI runtime.
The safest is probably to override it from Podman once the container is already started (after "start" terminates). Does systemd
work fine if you use MAINPID=
multiple times?
23bb7b9
to
03666d3
Compare
When NOTIFY_SOCKET is passed from systemd, we send MAINPID=<pid of conmon> so systemd monitors the correct PID. We do this both Before and After the OCI runtime engine start is called. Imported daemon/ from go-systemd dependency. Signed-off-by: Joseph Gooch <[email protected]> Co-authored-by: Giuseppe Scrivano <[email protected]>
03666d3
to
2600763
Compare
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 think we only need to send the MAINPID once in start. It's redundant in create.
Other than that LGTM. @giuseppe WDYT?
yes I agree. We need only for start, then LGTM |
I sent it twice, in case runc or crun passes a different MAINPID. conmon happens before OCI runtime, start happens after. Note also this PR is superceded by #6693 |
When NOTIFY_SOCKET is passed from systemd, we
send MAINPID= so systemd monitors the correct PID.
Imported daemon/ from go-systemd dependency.
Signed-off-by: Joseph Gooch [email protected]