/usr/bin/timeout doesn't reflect exit code of launched commandline
Bug #78742 reported by
Brak
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
tct (Debian) |
Fix Released
|
Unknown
|
|||
tct (Ubuntu) |
In Progress
|
Medium
|
Unassigned |
Bug Description
Binary package hint: timeout
Behold:
root@# grep foo /etc/hosts
root@# echo $?
1
root@# timeout -9 10 grep foo /etc/hosts
root@# echo $?
0
And some stracing... maybe I'm missing something. Here are the two commands like above, except with strace prepended, respectively.
close(1) = 0
exit_group(1) = ?
root@# echo $?
0
root@#
alarm(100) = 0
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], 0, NULL) = 24637
--- SIGCHLD (Child exited) @ 0 (0) ---
exit_group(256) = ?
root@# echo $?
0
root@#
Changed in tct: | |
importance: | Undecided → Medium |
status: | Unconfirmed → Confirmed |
Changed in tct: | |
status: | Unknown → Unconfirmed |
Changed in tct: | |
assignee: | daniel-ohuiginn → nobody |
Changed in tct: | |
status: | New → Fix Released |
To post a comment you must log in.
This is a bug which has been known for some years, and which the Debian maintainer has refused to fix without an OK from upstream. There's a patch attached to the Debian bug, which would solve the problem quite easily.
I'm in favour of fixing the bug, but it's possible that by now people are expecting timeout to behave in the broken way.
So, I'm going to take this bug on, run it past upstream, and fix either the program or the documentation depending on what they say.