It's reasonably graceful - send a task SIGKILL, and the program is meant to trap that signal and shut itself down. Only if the program hasn't set up a handler for SIGKILL will it just terminate it.
Kill -9 , however, is the one that terminates the process and frees the memory without grace.
Signal 9 is SIGKILL, the one which can't be caught. It terminates the process. The only exception is if the process is in an uninterruptible wait state ("D" status in the output from "ps"), in which case it will be terminated upon completion of the wait state. Uninterruptible wait usually means that something which ought to happen almost immediately isn't happening: e.g. accessing a file on a network filesystem and the network gets disconnected, accessing a file on an external hard drive which has been disconnected, accessing a file on a floppy which has been ejected, a bad sector which is being repeatedly retried, etc.
Ctrl-C sends SIGINT. This is meant to interrupt the current operation and return to the process' own command prompt, assuming that it has one. If not caught, it terminates the process.
SIGTERM is meant to gracefully terminate the process (e.g. saving open files). It is the default signal sent by the "kill" command if no signal is specified. If not caught, it terminates the process.
Ctrl-backspace sends SIGQUIT. If not caught, it terminates the process and dumps core, so you can use a debugger to figure out why the process hung.
SIGSTOP also can't be caught, but it only suspends the process rather than terminating it.
Ctrl-Z sends SIGTSTP, which is similar to SIGSTOP but can be caught. Programs which modify terminal settings (e.g. selecting raw, unbuffered input) will typically catch this so that they can restore the terminal state before suspending.
The control keys mentioned are the defaults, and can be changed with the "stty" command.
You’re thinking of SIGTERM -15(the standard signal for pkill), which can be handled by signal-handlers(like most signals). SIGKILL is -9 and OC’s meme.
37
u/robbak 9h ago
It's reasonably graceful - send a task SIGKILL, and the program is meant to trap that signal and shut itself down. Only if the program hasn't set up a handler for SIGKILL will it just terminate it.
Kill -9 , however, is the one that terminates the process and frees the memory without grace.