>From 56e4aa9d0c083b9e49747d51866e80acec1142a2 Mon Sep 17 00:00:00 2001 From: Bernhard Voelker Date: Sun, 5 Jul 2020 01:20:10 +0200 Subject: [PATCH] doc: clarify 'timeout -k' behavior * doc/coreutils.texi (timeout invocation): Document that the the duration of --kill-after=DURATION begins when sending the initial signal. Also mention that -k does not have any effect if timeout's duration is 0. Suggested by Jonny Grant . --- doc/coreutils.texi | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/doc/coreutils.texi b/doc/coreutils.texi index c072b1575..80ca2858c 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -18108,9 +18108,19 @@ themselves (like GDB for example). @opindex -k @opindex --kill-after Ensure the monitored @var{command} is killed by also sending a @samp{KILL} -signal, after the specified @var{duration}. Without this option, if the -selected signal proves not to be fatal, @command{timeout} does not kill -the @var{command}. +signal. + +The specified @var{duration} starts from the point in time when +@command{timeout} sends the initial signal to @var{command}, i.e., +not from the beginning when the @var{command} is started. + +This option has no effect if @command{timeout}'s duration is 0 and therefore +disables the associated timeout. + +This option may be useful if the selected signal did not kill the @var{command}, +either because the signal was blocked or ignored, or if the @var{command} takes +too long (e.g. for cleanup work) to terminate itself within a certain amount +of time. @item -s @var{signal} @itemx --signal=@var{signal} -- 2.27.0