To understand the problem of why Ctrl + C does not work, it is very helpful to understand what happens when you press it:
The kernel tty driver causes a Ctrl + C to "send a SIGINT signal to the attached process. You can read about the different signals via man signal:
SIGINT 2 Term Interrupt from keyboard
Programs can ignore that signal, as they can ignore SIGTSTP as well:
SIGTSTP 18,20,24 Stop Stop typed at tty
(Which is what most shells do when you press Ctrl + Z, which is why it is not guaranteed to work.)
There are some signals which can not be ignored by the process: SIGKILL, SIGSTOP and some others. You can send these signals via the kill command. So, to kill your hanging / zombieying process, just find the process ID (PID). For example, use pgrep
or ps
and then kill
it:
% kill -9 PID
screen
would be a possible solution, Allowing you to create a new window andkill
the process from there.