GNU bug report logs - #51135
timeout: --foreground causes exit status 124, even if KILL was used

Previous Next

Package: coreutils;

Reported by: Christoph Anton Mitterer <calestyo <at> scientia.net>

Date: Mon, 11 Oct 2021 18:02:02 UTC

Severity: normal

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

Bug is archived. No further changes may be made.

Full log


Message #28 received at 51135 <at> debbugs.gnu.org (full text, mbox):

From: Christoph Anton Mitterer <calestyo <at> scientia.net>
To: Pádraig Brady <P <at> draigBrady.com>, 51135 <at> debbugs.gnu.org
Subject: Re: bug#51135: timeout: --foreground causes exit status 124, even
 if KILL was used
Date: Tue, 12 Oct 2021 15:59:25 +0200
On Tue, 2021-10-12 at 14:50 +0100, Pádraig Brady wrote:
> That is a fair point.

Thanks for reconsidering :-)


> If one is using --kill-after you have to
> check for both 124 and 137 anyway to see if it timed out.
> It is useful to know whether the command was forcably killed.
> Using --foreground to avoid the 137 exit status upon --kill-after
> is not until now documented, so we should probably adjust
> the exit status to be always 137 if a SIGKILL is sent.
> 
> With the attached we now behave like:
> 
>    $ timeout -v -s0 --foreground -k2 1 sleep 3; echo $?
>    timeout: sending signal EXIT to command ‘sleep’
>    timeout: sending signal KILL to command ‘sleep’
>    137
> 
>    $ timeout -v -s0 -k2 1 sleep 3; echo $?
>    timeout: sending signal EXIT to command ‘sleep’
>    timeout: sending signal KILL to command ‘sleep’
>    Killed
>    137

Great :-)


Cheers,
Chris.




This bug report was last modified 3 years and 274 days ago.

Previous Next


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