GNU bug report logs - #6308
Preserve command exit code in timeout(3)

Previous Next

Package: coreutils;

Reported by: "Ángel González" <keisial <at> gmail.com>

Date: Sun, 30 May 2010 00:23:01 UTC

Severity: normal

Tags: moreinfo

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

Bug is archived. No further changes may be made.

Full log


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

From: Pádraig Brady <P <at> draigBrady.com>
To: Thomas Krennwallner <tkren <at> kr.tuwien.ac.at>
Cc: Ángel González <keisial <at> gmail.com>,
	Jim Meyering <jim <at> meyering.net>, 6308 <at> debbugs.gnu.org
Subject: Re: bug#6308: Preserve command exit code in timeout(3)
Date: Mon, 22 Oct 2012 10:20:14 +0100
On 10/21/2012 09:36 PM, Thomas Krennwallner wrote:
> Dear Jim, dear Pádraig,
>
> preserving the command's exit code is useful for, e.g., running solver
> competitions, where competition participants have an upper bound on the
> runtime for finding solutions to very hard problems.
>
> Imagine you want to run a command which is outputting (periodically or
> on-request) solutions to optimization problems, where better and better
> solutions will be printed over time, until the final solution is
> obtained.
>
> Now if the process gets interrupted by timeout's signal, the command
> will return with an exit code different from the one that means "final
> solution found".  If there was already an "interesting" solution found,
> a particular exit code would be returned, and if no solution has been
> found until the signal was received would result in yet another exit
> code.
>
> This way, one would easily obtain the status of the solution without
> parsing the output.  For exit code 124 one would only know that there
> was a timeout, but not if the computation has already revealed
> "interesting" results.
>
> I'm thus very interested into seeing timeout --exit-status.

Ok cool.

It's tempting to support this without an option.
I.E. for all commands that exit without WIFSIGNALED being set,
i.e. for all commands that catch and exit on signal reception.
However that wouldn't work in general I think due to cascading
timeout commands or commands that catch signals for cleanup etc.,
though I suppose the latter case might be catered for by
specifying a specific signal with the -s option.

So I'll look at adding this new option right after the
imminent 8.20 release.

thanks,
Pádraig.




This bug report was last modified 12 years and 243 days ago.

Previous Next


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