-
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
failed to execvp -podmansh: No such file or directory #22672
Comments
@lsm5 PTAL |
@bachradsusi PTAL |
A leading dash is traditionally an indicator that the process is a login shell, and this seems consistent with the Regardless of the cause, the proper solution is for podman to strip this leading dash. |
I have tried again with podmansh in /etc/shells, the output remains identical. |
Could you try to login via ssh or /bin/login? One thing you also try is with |
It actually did not occur to me to test theses.
|
The difference happens in https://github.com/containers/podman/blob/main/pkg/domain/infra/abi/system_linux.go#L39
|
Well first never use su/sudo to "login" into other rootless users. They do not create a proper systemd session and thus the resulting environment is less than ideal for podman, i.e. The issue here is that the first podman command you run after a boot has do do a re-exec of itself to create and join the userns. And since the quadlet unit is not started podmansh (just a wrapper for podman exec) is now the first podman command and that re-exec is failing likely because it cannot deal with the |
This can be reproduced by using
The problem is the the re-exec code uses argv0 as command for the exec call which will not exist, I work on a fix. |
Under some circumstances podman might be executed with a different argv0 than the actual path to the podman binary. This breaks the reexec logic as it tried to exec argv0 which failed. This is visible when using podmansh as login shell which get's the special -podmansh on argv0 to signal the shell it is a login shell. To fix this we can simply use /proc/self/exe as command path which is much more robust and the argv array is still passed correctly. Fixes containers#22672 Signed-off-by: Paul Holzinger <[email protected]>
#22695 should fix this error condition but using su will still not create a proper env and not spawn the systemd session so using ssh/machinectl or a normal terminal/gui login is the way to go. |
Thank you for the quick response and fix! |
Issue Description
Opening the session of a user with podmansh shell fails with the following error:
failed to execvp -podmansh: No such file or directory
The - before the executable name is suspicious but I failed to track it down in the code.
Steps to reproduce the issue
Steps to reproduce the issue
I have followed the man page (https://man.archlinux.org/man/extra/podman/podmansh.1.en#Setup)
Describe the results you received
The session exits immediately with the error message:
In the system log, it reads:
Describe the results you expected
The session opens.
podman info output
Podman in a container
No
Privileged Or Rootless
None
Upstream Latest Release
No
Additional environment details
OS: archlinux
Additional information
Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting
The text was updated successfully, but these errors were encountered: