If I want to kill a process as careful and politely as possible,
which signals should I use in a kill command, in which order?
I would like to give the programm any kind of time to clean up, if it likes to, so just sending a SIGTERM
will be to harsh, I think?
I'll use SIGKILL
("-9
") last, that's clear.
But which to start? SIGHUP
? Which signals are just a waste of time?
The relevant signals for reference, from
man 7 signal
Signal Value Action Comment
──────────────────────────────────────────────────────────────────────
SIGHUP 1 Term Hangup detected on controlling terminal
or death of controlling process
SIGINT 2 Term Interrupt from keyboard
SIGQUIT 3 Core Quit from keyboard
SIGKILL 9 Term Kill signal
SIGPIPE 13 Term Broken pipe: write to pipe with no
readers
SIGTERM 15 Term Termination signal