-
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
When running systemd in a container set container_uuid #13622
Conversation
@edsantiago PTAL |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rhatdan 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 |
LGTM |
You have the wrong issue number linked! |
Yeah, I don't understand the |
test/system/250-systemd.bats
Outdated
run_podman inspect test --format '{{ .ID }}' | ||
run expr substr "${output}" 1 32 | ||
is "$uuid" "$output" "UUID should be first 32 chars of Container id" | ||
|
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.
Suggestion:
run_podman inspect ...
is "$uuid" "${output:0:32}" "container_uuid envariable should be the first 32 chars of container ID"
run_podman rm test
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 figured you'd have an easier way.
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 find the use of UUID
here (in the comment) misleading, that's why I suggested "container_uuid envariable" instead.
Also, could you remove the unneeded trailing empty line?
Also, this seems the sort of thing that needs documenting, I just can't find where it should go
libpod/container_internal_linux.go
Outdated
@@ -968,6 +968,7 @@ func (c *Container) mountNotifySocket(g generate.Generator) error { | |||
// systemd expects to have /run, /run/lock and /tmp on tmpfs | |||
// It also expects to be able to write to /sys/fs/cgroup/systemd and /var/log/journal | |||
func (c *Container) setupSystemd(mounts []spec.Mount, g generate.Generator) error { | |||
g.AddProcessEnv("container_uuid", c.ID()[:32]) |
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 you should check that container_uuid
is not already set
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.
Fixed the fixed link as well. |
systemd expects the container_uuid environment variable be set when it is running in a container. Fixes: containers#13187 Signed-off-by: Daniel J Walsh <[email protected]>
LGTM |
/lgtm |
systemd expects the container_uuid environment variable be set
when it is running in a container.
Fixes: #13187
Signed-off-by: Daniel J Walsh [email protected]