Open saifelse opened 3 years ago
I'm unable to replicate this; either via the ctop-and-exit or background methods - can you confirm whether you're still seeing this behavior in the latest release?
On Ubuntu 20.04 (64-bit) it's not happening either:
I run ctop version 0.7.7
.
I've found that after running
ctop
, docker containers that are run with-t
(allocate pseudo TTY) in the same shell as ctop, will be interrupted with SIGIO. This is notably only noticeable if you are using an init process that rewires signal handlers, like dumb-init. If you don't use an init process likedumb-init
, the process will be run with pid=1, which is special: linux’s default signal handlers that cause a process to exit are not installed, and so SIGIO is silently swallowed. See: https://github.com/Yelp/dumb-init#why-you-need-an-init-systemMy hypothesis is that this may be
termui
-related, but I don't know enough about that library / Go to explore a more minimal repro that doesn't involvectop
.Steps to reproduce the problem:
ctop
and then exit (or evenctop &
)docker run --rm -it joelnb/dumb-init-ubuntu bash -c 'read -p Name: name && echo "Hi ${name}!"
What went wrong?
Instead of sending the character to stdin, the docker container immediately exits. Running
echo $?
shows exit code 157, which corresponds to unhandled signal 29 (SIGIO).What is the expected behavior?
The docker container should not exit and should keep capturing keyboard input, where upon hitting enter, prints
"Hi <whatever you typed>"
Example output
Good behavior followed by bad behavior
Software Versions
OS: macOS 10.15.7 Docker Desktop: 3.6.0.5487 Shell: bash 3.2.57 and zsh 5.7.1 Terminal emulator: iTerm2 3.4.8 and Terminal 2.10 ctop: 0.7.6 (installed via
brew
)