-
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
Unable to easily stop an interactive podman container (keyboard) #10469
Comments
Indeed, I can confirm this. Another workaround is to stop/kill the container from another terminal (but this is clearly not very friendly). Reproduced on:
|
Systemd always changes the Stop character to something only systemd understands, and you can not generate that at the keyboard. |
man podman run |
The issue is that systemd ignores all of these control chars. |
@mheon Could we theoretically translate the ^c from the TTY to the stop signal of the container when Podman is attached. But even if we could this might not be what the user expects. |
@rhatdan That seems dangerous. What if the user actually wanted to send SIGTERM? I think this is a unique case, and needs to be treated as one. Systemd only wants to stop if given a very specific and very unusual signal - SIGINT and SIGTERM as you might get with kill/Control-C are not sufficient. I think we have to respect systemd's wishes here. |
While I can understand @mheon concerns about changing default behavior, I do not see why we should not improve the user experience and log something like below when running with
Later we could even add another opt-in (configurable option) that translates a ^C, so users may be able to obtain the behavior they want, without risking affecting the default behavior. |
What happens when the --systemd flag is enabled, because you are using systemd within the container? We envisioned --systemd=always as mainly a debugging tool. |
Is not so much about what am I using and more about what others are using podman with. I maintain ansible molecule testing framework and I cannot prevent people from starting containers with systemd or not. The default is not, but a significant number do try to use system as they want to test deployment of various services. IMHO, I am yet to see the first user that starts a container in console interactive mode but he does not want to be able to use Ctrl-C to stop it after. What is the purpose of starting a console app the you cannot stop? I think that exposing the tricks needed for stopping such runs could help improve overall user experience. If you want I can survey few others about expectations and tell the to comment as I do not want to impose my view of what the cli should do or not. After digging these days I am sure I will not forget about the ^P^Q trick any time soon. |
There are lots of tools that ignore ^c, so this is not that unusual. |
So if I run an application that does not ignore ctrl^c. then it works. If I launch Bash, it the ^c is passed to processes within the shell. We don't kill the session. |
When running an interactive process like
podman run --systemd=always -it fauust/docker-systemd:debian-10
you endup with an app that seems to not be responsive to any standard stop/kill signals.Ctrl-C
no effectCtr-D
no effectCtrl-\
no effectCtrl-P Ctrl-Q
, but clearly that magic combination is not advertised by the application when it starts.Ideally
Ctrl-D
andCtrl-C
should just work but if there is a technical reason why this cannot be fixed we should at least assure that podman does advertise onstderr
the magic key combinations needed.Reproduced on:
podman version 3.1.2
on macos (remoting)poadman version 3.1.2
on fedora 34Related #4397
The text was updated successfully, but these errors were encountered: