diff options
author | Pádraig Brady <P@draigBrady.com> | 2010-03-15 23:03:30 +0000 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2010-03-16 23:10:15 +0000 |
commit | c403c31e8806b732e1164ef4a206b0eab71bca95 (patch) | |
tree | c593bccff037db3c5f332810aec7dfbc33a30683 /doc | |
parent | 4edb86215deec3ad7478eb4eca54d563bd3b95c0 (diff) | |
download | coreutils-c403c31e8806b732e1164ef4a206b0eab71bca95.tar.xz |
timeout: add the --kill-after option
Based on a report from Kim Hansen who wanted to
send a KILL signal to the monitored command
when `timeout` itself received a termination signal.
Rather than changing such a signal into a KILL,
we provide the more general mechanism of sending
the KILL after the specified grace period.
* src/timeout.c (cleanup): If a non zero kill delay
is specified, (re)set the alarm to that delay, after
which a KILL signal will be sent to the process group.
(usage): Mention the new option. Separate the description
of DURATION since it's now specified in 2 places.
Clarify that the duration is an integer.
(parse_duration): A new function refactored from main(),
since this logic is now called for two parameters.
(main): Parse the -k option.
* doc/coreutils.texi (timeout invocation): Describe the
new --kill-after option and use @display rather than
@table to show the duration suffixes. Clarify that
a duration of 0 disables the associated timeout.
* tests/misc/timeout-parameters: Check invalid --kill-after.
* tests/misc/timeout: Check a valid --kill-after works.
* NEWS: Mention the new feature.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/coreutils.texi | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/doc/coreutils.texi b/doc/coreutils.texi index 34ccf5a6b..e7c09c5e1 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -15221,31 +15221,25 @@ might find this idea strange at first. still running after the specified time interval. Synopsis: @example -timeout [@var{option}] @var{number}[smhd] @var{command} [@var{arg}]@dots{} +timeout [@var{option}] @var{duration} @var{command} [@var{arg}]@dots{} @end example -@cindex time units -@var{number} is an integer followed by an optional unit; the default -is seconds. The units are: - -@table @samp -@item s -seconds -@item m -minutes -@item h -hours -@item d -days -@end table - @var{command} must not be a special built-in utility (@pxref{Special built-in utilities}). -The program accepts the following option. Also see @ref{Common options}. +The program accepts the following options. Also see @ref{Common options}. Options must precede operands. @table @samp +@item -k @var{duration} +@itemx --kill-after=@var{duration} +@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}. + @item -s @var{signal} @itemx --signal=@var{signal} @opindex -s @@ -15253,9 +15247,18 @@ Options must precede operands. Send this @var{signal} to @var{command} on timeout, rather than the default @samp{TERM} signal. @var{signal} may be a name like @samp{HUP} or a number. Also see @xref{Signal specifications}. - @end table +@cindex time units +@var{duration} is an integer followed by an optional unit: +@display +@samp{s} for seconds (the default) +@samp{m} for minutes +@samp{h} for hours +@samp{d} for days +@end display +A duration of 0 disables the associated timeout. + @cindex exit status of @command{timeout} Exit status: |