aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2016-12-05 10:24:54 +0100
committerMichael Kerrisk <mtk.manpages@gmail.com>2016-12-05 16:51:15 +0100
commit3d463c677e773373d2dd59f52d9109b05b36bb08 (patch)
tree6d968e780f920eacd2e83f8b1290e9c9e60ccb91
parentb79cc53b43ca7cc3fefbb8dd725c8e3eb811ad09 (diff)
downloadutil-linux-3d463c677e773373d2dd59f52d9109b05b36bb08.tar.gz
docs: kill(1): Add more detail on use of SIGTERM vs SIGKILL
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>
-rw-r--r--misc-utils/kill.114
1 files changed, 11 insertions, 3 deletions
diff --git a/misc-utils/kill.1 b/misc-utils/kill.1
index 14e6f3d961..091de407d3 100644
--- a/misc-utils/kill.1
+++ b/misc-utils/kill.1
@@ -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