-
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
logging: new mode -l passthrough #11390
logging: new mode -l passthrough #11390
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: giuseppe 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 |
@vrothberg what do you think? This should improve integration with systemd (but some commands won't work) |
Changes LGTM |
cmd/podman/containers/run.go
Outdated
@@ -200,7 +200,7 @@ func run(cmd *cobra.Command, args []string) error { | |||
return err | |||
} | |||
|
|||
if runOpts.Detach { | |||
if runOpts.Detach && cliVals.LogDriver != define.PassthroughLogging { |
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.
Shouldn't these conflict? It doesn't seem particularly sane to log to the terminal's STDOUT and STDERR when the process is no longer attached to the controlling terminal.
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.
the fds are passed down to the container that can still use them.
I think the only sane usage of this option is within a systemd service.
Using a tty won't be allowed by conmon as it opens to security issues: https://github.com/containers/conmon/pull/289/files#diff-26c58c117a24670c396f3e8e3e86cd6a6f134b3f02f84f8c894213c16c542d4cR165-R166
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.
Can we get documentation to that effect? I was very confused by what this option was for.
Also, I think conflicting with --tty
makes a lot of sense - we won't have split stderr/stdout, and won't have raw mode set so the output will likely be garbage.
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 like Matt's suggestion
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 added the error also to Podman so we don't rely on conmon checking for it
fda5a63
to
37929c6
Compare
converted to draft. Let's wait for the conmon change to be accepted first |
df7aae1
to
bead1cd
Compare
Ok, I played with this by launching podman with the passthrough log driver from a systemd service, and it works just like I expected. For example, it properly picks up the syslog identifiers set by the systemd unit, and the individual journal entries are tagged with the correct pid, cmdline and exe (i.e. not everything looks like it came from conmon). The one issue I have is that the systemd journal connection has a system_u:system_r:init_t:s0 selinux context and the container is running in system_u:system_r:container_runtime_t:s0, so I'm getting AVC denied when writing to the journal breaking selinux enforcing mode. I wonder what is the best way to handle this. @rhatdan opinions? |
These are the AVCs i get:
|
This should be fixed in container-selinux. |
Looks like this is allowed in current container-selinux. container-selinux-2.167 $ audit2allow -i /tmp/t #============= container_t ============== #!!!! This avc is allowed in the current policy |
Ok. I'm only on |
@alexlarsson Have you updated to the latest container-selinux to the latest version to make sure it works. |
bead1cd
to
401583c
Compare
401583c
to
d9f1d3d
Compare
d9f1d3d
to
887d8a3
Compare
it allows to pass the current std streams down to the container. conmon support: containers/conmon#289 [NO TESTS NEEDED] it needs a new conmon. Signed-off-by: Giuseppe Scrivano <[email protected]>
887d8a3
to
3ce98a5
Compare
this is ready |
Can you add a test? |
the issue is that it needs a new conmon which is not available in the CI |
Lets get this in, and then add tests when the new conmon is ready. Then the people who need this IE @alexlarsson can start playing with it now, and see if there are any issues. |
LGTM |
/lgtm |
it allows to pass the current std streams down to the container.
conmon support: containers/conmon#289
[NO TESTS NEEDED] it needs a new conmon.
Signed-off-by: Giuseppe Scrivano [email protected]