When I run a cat command as a background process,
$ cat &
and then try to kill it,
$ killall -v cat
it says that it killed cat with signal 15, but also that cat was only stopped. Upon running $ ps
, I see that it is still running. It isn't until I call $ fg
that it is finally terminated.
It appears to be related to waiting for input, because when simulating cat in c++,
string line;
while(getline(cin, line))
cout << line << endl;
the same thing happens, but for a simple while(true);
loop, the process is killed successfully.
It also appears to be necessary that it is a background process because when I run $ cat
and in another terminal $ killall -v cat
it also works fine.
What is going on here? Thanks in advance.