SIGTERM vs. SIGKILL
SIGTERMsignal is a generic signal used to cause program termination. Unlike
SIGKILL, this signal can be blocked, handled, and ignored. It is the normal way to politely ask a program to terminate.
The shell command
SIGKILLsignal is used to cause immediate program termination. It cannot be handled or ignored, and is therefore always fatal. It is also not possible to block this signal.
This signal is usually generated only by explicit request. Since it cannot be handled, you should generate it only as a last resort, after first trying a less drastic method such as C-c or
SIGTERM. If a process does not respond to any other termination signals, sending it a
SIGKILLsignal will almost always cause it to go away.
In fact, if
SIGKILLfails to terminate a process, that by itself constitutes an operating system bug which you should report.
The system will generate
SIGKILLfor a process itself under some unusual conditions where the program cannot possibly continue to run (even to run a signal handler).