GNU bug report logs - #70219
Bug/Issue with timeout and signals

Previous Next

Package: coreutils;

Reported by: "Branden R. Williams" <brw <at> brandenwilliams.com>

Date: Fri, 5 Apr 2024 18:01:03 UTC

Severity: normal

Tags: notabug

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Chris Elvidge <celvidge001 <at> gmail.com>
To: "Branden R. Williams" <brw <at> brandenwilliams.com>, 70219 <at> debbugs.gnu.org
Subject: bug#70219: Bug/Issue with timeout and signals
Date: Fri, 5 Apr 2024 22:59:33 +0100

On 05/04/2024 at 16:19, Branden R. Williams via GNU coreutils Bug 
Reports wrote:
> I was integrating the timeout command into a shell script and realized the manpage & the --help docs do not accurately describe how the tool works. In addition, there appears to be a bug related to arguments passed. I am running version 9.1.
> 
> According to the help screen, this command should work:
> 
> 	timeout -k 10s ping example.com <http://example.com/>
> 
> It fails, however, because the next argument after invoking -k is the kill signal you want to send. The command (to send a SIGKILL) must be:
> 

As I understand it, the argument after -k (or --kill-after=) is the time 
to wait and send the kill signal if the timeout fails.
So this line:

> 	timeout -k 9 10s ping example.com <http://example.com/>
> 

sends a kill signal 9 seconds after the timeout, if the timeout hasn't 
worked.

The -s option is to change the signal sent (as below).

> I believe the kill after functionality and docs should be modified to send a default signal of SIGTERM without an additional argument so the first iteration above would work. Then you could explain that if you wanted to send a DIFFERENT signal, use the -s flag that is there to pass one. But according to the docs, the first command SHOULD work. Even using the --kill-after= syntax passes in the kill signal into that argument, not the actual time.
> 
> Thank you for your consideration and for maintaining such a critical set of tools!
> 
> Regards,
> 
> B
> 
> 


-- 

Chris Elvidge





This bug report was last modified 1 year and 46 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.