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

2021-10-12 Thread Christoph Anton Mitterer
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

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

2021-10-12 Thread Pádraig Brady
On 12/10/2021 02:55, Christoph Anton Mitterer wrote: Thinking again about this: Don't you think one looses quite something if, with --foreground, one cannot differ (via the exit status) between a timeout that allowed the program to clean up and one (when KILLing) that didn't? Even if the KILL

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

2021-10-11 Thread Christoph Anton Mitterer
Thinking again about this: Don't you think one looses quite something if, with --foreground, one cannot differ (via the exit status) between a timeout that allowed the program to clean up and one (when KILLing) that didn't? Even if the KILL happens via killing timeout itself, couldn't it just

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

2021-10-11 Thread Christoph Anton Mitterer
On Mon, 2021-10-11 at 22:20 +0100, Pádraig Brady wrote: > 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. But wouldn't that make me loose the 124, if COMMAND could actually be SIGTERMed?

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

2021-10-11 Thread Pádraig Brady
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

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

2021-10-11 Thread Christoph Anton Mitterer
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

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

2021-10-11 Thread Pádraig Brady
On 11/10/2021 19:01, Christoph Anton Mitterer wrote: Hey. This time I've also checked the 9.0 documentation (hopefully I wasn't just too blind). I noticed that whenever --foreground is used, timeout exits with a 124 status (instead of the documented 128+9) regardless of whether the KILL is

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

2021-10-11 Thread Christoph Anton Mitterer
Hey. This time I've also checked the 9.0 documentation (hopefully I wasn't just too blind). I noticed that whenever --foreround is used, timeout exits with a 124 status (instead of the documented 128+9) regardless of whether the KILL is sent because of --signal=KILL or --kill-after=n .