-
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 LISTEN_* environment into container #11316
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vrothberg The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Does socket activation work properly after this? |
/hold
Will run more tests tomorrow
…On Tue 24 Aug 2021 at 19:09, Daniel J Walsh ***@***.***> wrote:
Does socket activation work properly after this?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#11316 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACZDRA67I3VY7E6DFDSUIU3T6PG4DANCNFSM5CXDSUAA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>
.
|
@vrothberg you have a merge conflict. |
LGTM |
we can do that in crun as well, but I think it is still safer to set in Podman as this PR does |
@vrothberg @giuseppe sure having this at podman is much safer also added a PR at |
@rhatdan, I finally got it working but only without selinux:
Do I need to perform some labeling on the FDs? |
Are you creating the FDs? If yes, then you need to call label.SetSocketOpt(ProcessLabel) on them before leaking them. |
/hold |
selinux issue fixed by @rhatdan (https://github.com/containers/container-selinux/releases/tag/v2.167.0) |
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.
@containers/podman-maintainers PTAL
Will work on an improved test once selinux changes made it into Fedora.
/hold cancel
LGTM once @mheon's concern is addressed |
7ba166e
to
ce099b8
Compare
Another F34 time out, restarted. |
Make sure that Podman passes the LISTEN_* environment into containers. Similar to runc, LISTEN_PID is set to 1. Also remove conditionally passing the LISTEN_FDS as extra files. The condition was wrong (inverted) and introduced to fix containers#3572 which related to running under varlink which has been dropped entirely with Podman 3.0. Note that the NOTIFY_SOCKET and LISTEN_* variables are cleared when running `system service`. Fixes: containers#10443 Signed-off-by: Daniel J Walsh <[email protected]> Signed-off-by: Valentin Rothberg <[email protected]>
/lgtm |
When I read this quote from I'm a bit curious what any other file descriptors means. Maybe container-selinux needs to allow all kinds of file descriptors? (I don't know so much about SELINUX so sorry for any confusion on my part) Taking a look at When I find some time for it, I will experiment and see how the socket activation works together with |
@eriksjolund, indeed while testing I ran into SELinux issues which @rhatdan has fixed in the meantime. Feel free to drop a message when you find time to get back. |
@vrothberg I think it is time for us to write a long blog on the integration between Podman and Systemd. |
Started one this morning :-) I'll add you after PTO :^) |
Sadly, I am not on PTO this afternoon (Customer meeting) or tomorrow for devconf.US. |
// Force the PID to `1` since we cannot rely on (all | ||
// versions of) all runtimes to do it for us. | ||
if key == "LISTEN_PID" { | ||
val = "1" |
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.
What if the user passed --init, then the main pid will be 2. Who is supposed to rewrite that. For sure catatonit (currently used on e.g. fedora) doesn't do that.
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.
@alexlarsson This is been fixed in underlying runtime via containers/crun#721 if catatonit sets LISTEN_PID=2
crun will adhere it. We can remove this explicit LISTEN_PID=1
once latest crun is released and vendor-ed into the Podman CI.
However following edge case still remains if OCI runtime is runc
this is only fixed for crun
. cc @giuseppe
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.
Fair point, @ alexlarsson. I think Podman should set it since we should not (and to a certain degree cannot) rely on the runtimes or inits to do this work.
Mind opening a PR against Podman?
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.
ftr, @giuseppe is fixing catatonit here: openSUSE/catatonit#15
This was added in the old quadlet to work around issues with podman not passing on notify fds and pids. However, these are now fixed with: containers#11316 openSUSE/catatonit#15 So, remove this key (which was never in a podman release anyway) Signed-off-by: Alexander Larsson <[email protected]>
Make sure that Podman passes the LISTEN_* environment into containers.
Similar to runc, LISTEN_PID is set to 1.
Also remove conditionally passing the LISTEN_FDS as extra files.
The condition was wrong (inverted) and introduced to fix #3572 which
related to running under varlink which has been dropped entirely
with Podman 3.0. Note that the NOTIFY_SOCKET and LISTEN_* variables
are cleared when running
system service
.Fixes: #10443
Signed-off-by: Daniel J Walsh [email protected]
Signed-off-by: Valentin Rothberg [email protected]