]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
docs: kill(1): Add more detail on use of SIGTERM vs SIGKILL
authorMichael Kerrisk <mtk.manpages@gmail.com>
Mon, 5 Dec 2016 09:24:54 +0000 (10:24 +0100)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Mon, 5 Dec 2016 15:51:15 +0000 (16:51 +0100)
It's worth adding a recommendation here to use SIGTERM
rather than SIGKILL, and explain why.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
misc-utils/kill.1

index 14e6f3d9610af474120d1618aff49468ceed8fc4..091de407d38a0b5bb5e924421121dd0b8b4f36aa 100644 (file)
@@ -21,9 +21,17 @@ kill \- terminate a process
 The command
 .B kill
 sends the specified \fIsignal\fR to the specified processes or process groups.
-If no signal is specified, the TERM signal is sent.  This TERM signal will kill
-processes that do not catch it; for other processes it may be necessary to use
-the KILL signal (number 9), since this signal cannot be caught.
+.PP
+If no signal is specified, the TERM signal is sent.
+The default action for this signal is to terminate the process.
+This signal should be used in preference to the
+KILL signal (number 9), since a process may install a handler for the
+TERM signal in order to perform clean-up steps before terminating in
+an orderly fashion.
+If a process does not terminate after a TERM signal has been sent,
+then the KILL signal may be used; be aware that the latter signal
+cannot be caught, and so does not give the target process the opportunity
+to do perform any clean-up before terminating.
 .PP
 Most modern shells have a builtin kill function, with a usage rather similar to
 that of the command described here.  The