Is there a need for an official systemd unit podman-usernamespace.service? #19370
eriksjolund
started this conversation in
General
Replies: 2 comments 2 replies
-
Why not run the container with nonewprivs instead of Podman? |
Beta Was this translation helpful? Give feedback.
1 reply
-
Not sure if this breaks certain podman commands as well Does podman run --uidmap ... type commands continue to work? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I sometimes need an extra systemd user service that is only responsible for the pause process (catatonit).
When I have a systemd user service that is more restricted (e.g. restricted with
NoNewPrivileges=yes
),a Podman process in such a service would not be able to execute /usr/bin/newuidmap and /usr/bin/newgidmap with the extra capabilities those executables have:
Unless the Podman user namespace has already been set up, such a systemd user service would fail.
Here is an example where a Podman command first fails, but after running
podman unshare /bin/true
, the same Podman command starts to work:On a Fedora 38 machine
Running /usr/bin/newuidmap and /usr/bin/newgidmap is only needed when the
Podman user namespace is set up. Setting it up just needs to be done once after a reboot.
For example the command
podman unshare /bin/true
sets up the Podman user namespace.Do you have any recommendations of how such a systemd user service should look like?
Is
podman unshare /bin/true
a good command to use?In the blog post
https://www.redhat.com/sysadmin/podman-systemd-limit-access
I used:
I think that the podman RPM package could include a podman-usernamespace.service unit so that
there is an official way to start the podman user namespace. Such a service could be added as a dependency
when creating container units or service units. I'm not sure if
podman generate systemd
and quadlet should add such a dependency by default.Do you think there is a need for an official systemd unit podman-usernamespace.service?
Side note 1: Currently the podman RPM package includes these units:
Side note 2: conmon-rs might also have a need for podman-usernamespace.service
Beta Was this translation helpful? Give feedback.
All reactions