-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add user systemd service and socket #3662
Add user systemd service and socket #3662
Conversation
Hi @marusak. Thanks for your PR. I'm waiting for a containers or openshift 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. |
Can one of the admins verify this patch?
|
@baude PTAL |
I think the latest podman commands work without setting up a systemd unit file/service. podman-remote commands are supposed to automatically launch a |
this is true for podman-remote when using the bridge. |
pause.pid is used for rootless containers to keep the user namespace alive so that all containers can run from the same namespace. Looks like systemd is killing all the processes in the cgroup when you start it from a unit file. Can you try with |
Awesome, adding it into the service file fixes it. Is |
root containers don't need a pause process as they don't need to join the same user namespace. |
although we can probably simplify and add it for root containers as well |
@marusak could you amend your patch to include it? |
of course, I'll push here in a bit. |
I don't think we have tests for |
254b600
to
241c46c
Compare
Updated |
/ok-to-test |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: giuseppe, marusak 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 |
please add a You can do it with |
241c46c
to
d106ab2
Compare
Added |
One issue I've found. Not sure if this is related to these changes or this has nothing to do with this change, but I cannot call
|
I think stats is an expected failure for rootless - probably need to touch up the error message. It requires CGroups to be present, but rootless Podman has no privileges to make CGroups. |
No privs for cgroupsV1... |
I opened #3749 not to block this as that happens on master as well. |
Does this need some additional attention from my side? |
@marusak Can you rebase and repush. There were lots of fixes in the CI system on Friday, that should make this PR mergable. |
d106ab2
to
d14c23a
Compare
Done |
Makefile
Outdated
@@ -397,7 +398,9 @@ install.docker: docker-docs | |||
install.systemd: | |||
install ${SELINUXOPT} -m 755 -d ${DESTDIR}${SYSTEMDDIR} ${DESTDIR}${TMPFILESDIR} |
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.
You need to crate your ${DESTDIR}${USERSYSTEMDDIR} here.
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.
Thanks for spotting! fixed
@@ -397,7 +398,9 @@ install.docker: docker-docs | |||
install.systemd: | |||
install ${SELINUXOPT} -m 755 -d ${DESTDIR}${SYSTEMDDIR} ${DESTDIR}${TMPFILESDIR} | |||
install ${SELINUXOPT} -m 644 contrib/varlink/io.podman.socket ${DESTDIR}${SYSTEMDDIR}/io.podman.socket | |||
install ${SELINUXOPT} -m 644 contrib/varlink/io.podman.socket ${DESTDIR}${USERSYSTEMDDIR}/io.podman.socket |
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.
Or do we need a -D in install.
This enables user to interact with varlink and create/manage rootless containers through it. Using as: `varlink call unix:/run/user/1000/podman/io.podman/io.podman.ListContainers` Signed-off-by: Matej Marusak <[email protected]>
d14c23a
to
daf7044
Compare
@giuseppe @vrothberg PTAL |
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.
LGTM
/lgtm |
This enables user to interact with varlink.
Before this PR user could only do
sudo varlink call unix:/run/podman/io.podman/io.podman.ListContainer
to list containers owned by root. With this PR a normal user can also callvarlink call unix:/run/user/1000/podman/io.podman/io.podman.ListContainers
which lists user owned containers.I have one problem though. Can someone please give me some hints, I admit I don't really understand how and why
pause.pid
is used, but it seems it causes some problem. Here is how to reproduce my problem:This works just fine after I start my machine. Steps I do:
systemctl --user start io.podman.socket
varlink call unix:/run/user/1000/podman/io.podman/io.podman.ListContainers
Unable to connect: CannotConnect
Removing
/run/user/1000/libpod/pause.pid
and restarting both socket and service I can get it to the same state as after boot, but doing varlink call gets it back to the same failed state. (varlink call returnsConnection closed.
)If I reboot the machine I can do exactly one varlink call and then get back to this failed state.