-
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
Problem running rootless podman from a daemon user #6383
Comments
The problem is that you are not using a full user account. So XDG_RUNTIME_DIR is not enabled. |
@giuseppe @mheon @vrothberg Can't we at least make the error message more helpful, since this is such a common issue that people hit. |
I think that's a good idea 👍 Let's see what our systemd friends come up with. I still hope we find a way to properly support that (or give guidelines). |
Can you try |
Yes, that's the problem. It does not get changed.
The result is I know, when doing a proper login with Because the actual setup is the following: So the real problem is rather running Thank you for the quick responses! |
@giuseppe I don't think it's really a duplicate The error message from podman run is actually So, my question is now: Is there any other environment varibale which leds to the reading of the wrong The executing user is not root, and the execution is done via a process which runs under Some additonal information:
in that context. |
maybe |
yes, i just figured that out I found systemd/systemd#9652 which somehow describes a similar problem. For us, we now use this fix to get podman running properly from systemd:
I will investigate a little bit more into systemd, maybe I can find a proper solution. |
@ck-schmidi could you give a try to You may need to set linger mode so that the containers are left around when you terminate the user session |
A friendly reminder that this issue had no activity for 30 days. |
I think we have a work around closing, reopen if I am mistaken. |
@giuseppe This is exactly the same problem that holds me already more than month in ##12247 and ##12264 and .. all my other issues. The only differences is that I use Fedora 34 Workstation with GNOME 4 and, another method to switch users. This is exactly the same Systemd environment hell ! When GNOME session is started by systemd including GNOME Terminal application The Systemd environment is settled by different things: generators, services: systemd-pam dbus-broker, etc. $USER, XDG_CONFIG_HOME, XDG_DATA_HOME added to environment at different timepoints. I tried to run CRun as the systemd service and it doesn't work too returning -1. instead of 125 returned by podman. Actually, I saw in some place that Systemd doesn't promise that $HOME closely follows the user switch because it can be needed for some systemd features. like Dynamic user. |
/kind bug
Description
We plan to run our Nagios Monitoring Checks from Container via Docker or Podman.
So far, we don't have any issues with standard Docker, but we can't figure out a proper
solution for CentOS/Podman setups.
We want to run our plugins from Nagios via
podman run
.For our test via just configured
podman run --rm hello-world
as our Plugin call. We got the following error message inour monitoring system:
Error: could not get runtime: error generating default config from memory: cannot mkdir /run/user/0/libpod: mkdir /run/user/0/libpod: permission denied
So I tried to reproduce this error without running within Nagios.
Steps to reproduce the issue:
Being logged in with the
root
user I try to switch the user withsu nagios
Running
podman run --rm hello-world
gives me the error I mentioned above.Describe the results you received:
Running the podman command always gets me:
Describe the results you expected:
Output should be:
Additional information you deem important (e.g. issue happens only occasionally):
I already spend a lot of time finding solutions online. This issue (5049) gave me some hints and also refered to the troubleshooting document, but it doesn't really help me.
They main difference is: When I switch the user via
su - nagios
the properenvironment is populated and the
podman run
command does work. Switching the user withsu nagios
(and thats probably comparable with the nagios daemon call) the problem appears.A good hint from this discussion was checking the
XDG_RUNTIME_DIR
env variable.With
su - nagios
the value is empty,with
su nagios
the value is/run/user/0
(which probably could be the problem)Output of
podman version
:With
su - nagios
it is:With
su nagios
it is (always the same error of course):Output of
podman info --debug
:With
su - nagios
it is:With
su nagios
it is (always the same error of course):Package info (output of
rpm -q podman
):The text was updated successfully, but these errors were encountered: