Why does killall (sometimes?) need to be applied twice? Here's an example where a "double" killall
is needed to end the process.
When and why does a process needed to be killed "twice"? What happens under the bonnet?
command linekillkillallprocess
Why does killall (sometimes?) need to be applied twice? Here's an example where a "double" killall
is needed to end the process.
When and why does a process needed to be killed "twice"? What happens under the bonnet?
Best Answer
I am going to state a application-specific possibility.
When you use
killall program
, aSIGTERM
(signal 15) is sent to the program. The usual response toSIGTERM
is that the program would exit gracefully.Now as the
SIGTERM
is catchable, a program can have a signal handler forSIGTERM
that would do some task upon receiving the firstSIGTERM
(firstkillall
) and return to a state where the secondSIGTERM
would just terminate it (default action). This is highly dependent on the developer of the program of course and not a general case.