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


View this message in rfc822 format

From: Pádraig Brady <P <at> draigBrady.com>
To: Christoph Anton Mitterer <calestyo <at> scientia.net>, 51135 <at> debbugs.gnu.org
Subject: bug#51135: timeout: --foreground causes exit status 124, even if KILL was used
Date: Mon, 11 Oct 2021 22:20:34 +0100
On 11/10/2021 22:11, Christoph Anton Mitterer wrote:
> On Mon, 2021-10-11 at 22:04 +0100, Pádraig Brady wrote:
>> +However if the @option{--foreground} option is specified then
>> +@command{timeout} will not send any signals to its own process,
>> +and so it will exit with one of the other exit status values
>> detailed above.
> 
> So 137 is only used when the signal was sent to timeout itself?
> 
> I'd have actually found it quite nice if 137 was used *even* with
> --foreground.
> 
> That way one could differentiate between whether COMMAND had the chance
> to do cleanups, or whether the calling process should take care on
> that.
> 
> 
> For example, I use timeout with a program that reads a phassphrase and
> prints it to stdout.
> It disables the terminal's ECHO, so when it has to be killed, the
> calling process would need to re-enable that mnually.

For that use case it's probably best to use --preserve-status,
in which case the 137 from the child getting the SIGKILL
will be propagated through.




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

Previous Next


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