bug#8938: make timeout and CTRL-C

2011-07-08 Thread Pádraig Brady
On 07/07/11 12:13, Jim Meyering wrote: > Pádraig Brady wrote: > >> On 07/07/11 11:05, Pádraig Brady wrote: >>> On 06/07/11 23:37, Pádraig Brady wrote: OK I've added --foreground to support this. Note it still maintains a separate timeout monitor process to return 124 on timeout etc.

bug#8938: make timeout and CTRL-C

2011-07-08 Thread Pádraig Brady
On 07/07/11 11:55, Jim Meyering wrote: > You probably have a test case, but just forgot to include it. > This is subtle enough that it deserves one, if it's not too much work. The test is a bit awkward, but worth adding. Applying now... cheers, Pádraig.

bug#8938: make timeout and CTRL-C

2011-07-07 Thread Jim Meyering
Pádraig Brady wrote: > On 07/07/11 11:05, Pádraig Brady wrote: >> On 06/07/11 23:37, Pádraig Brady wrote: >>> OK I've added --foreground to support this. >>> Note it still maintains a separate timeout >>> monitor process to return 124 on timeout etc. >> >> Updated wording and NEWS entry now includ

bug#8938: make timeout and CTRL-C

2011-07-07 Thread Jim Meyering
Pádraig Brady wrote: > On 06/07/11 23:37, Pádraig Brady wrote: >> OK I've added --foreground to support this. >> Note it still maintains a separate timeout >> monitor process to return 124 on timeout etc. > > Updated wording and NEWS entry now included. > I'll push this later today. Thanks! This

bug#8938: make timeout and CTRL-C

2011-07-07 Thread Pádraig Brady
On 07/07/11 11:05, Pádraig Brady wrote: > On 06/07/11 23:37, Pádraig Brady wrote: >> OK I've added --foreground to support this. >> Note it still maintains a separate timeout >> monitor process to return 124 on timeout etc. > > Updated wording and NEWS entry now included. > I'll push this later to

bug#8938: make timeout and CTRL-C

2011-07-07 Thread Pádraig Brady
On 06/07/11 23:37, Pádraig Brady wrote: > OK I've added --foreground to support this. > Note it still maintains a separate timeout > monitor process to return 124 on timeout etc. Updated wording and NEWS entry now included. I'll push this later today. cheers, Pádraig. >From b7326b5b54cfa44a022ec5

bug#8938: make timeout and CTRL-C

2011-07-06 Thread Pádraig Brady
On 28/06/11 19:45, Paul Eggert wrote: > On 06/28/11 11:41, Pádraig Brady wrote: >> The main problem with that is would only >> send the signal to the first process, and >> any processes it started would keep running. > > Yes, that's the main issue with it. Still, > it's handy for programs where y

bug#8938: make timeout and CTRL-C

2011-07-02 Thread Pádraig Brady
On 02/07/11 22:38, Alan Curry wrote: > =?ISO-8859-1?Q?P=E1draig_Brady?= writes: >> >> Given the above setsid make example (which hangs for 10s >> ignoring Ctrl-C, I'm leaning towards `make` needing to >> be more shell like, or at least forward the SIGINT etc. >> to the job, and not assume jobs run

bug#8938: make timeout and CTRL-C

2011-07-02 Thread Alan Curry
=?ISO-8859-1?Q?P=E1draig_Brady?= writes: > > Given the above setsid make example (which hangs for 10s > ignoring Ctrl-C, I'm leaning towards `make` needing to > be more shell like, or at least forward the SIGINT etc. > to the job, and not assume jobs run in the foreground group). I'm a little wor

bug#8938: make timeout and CTRL-C

2011-07-02 Thread Pádraig Brady
On 29/06/11 10:55, Pádraig Brady wrote: > On 28/06/11 20:10, Alan Curry wrote: >> =?ISO-8859-1?Q?P=E1draig_Brady?= writes: >>> >>> I'm still not convinced we need to be messing with tcsetpgrp() >>> but you're right in that the disconnect between the timeout >>> process group and that of whatever st

bug#8938: make timeout and CTRL-C

2011-07-02 Thread Pádraig Brady
On 02/07/11 19:36, shay shimony wrote: >> With this patch the child is guaranteed to not be in the foreground (as far >> as the tty knows) so it will be getting SIGTTIN and possibly SIGTTOU on tty >> operations. > > You may need to correct me. In practice we see that the "timeouted" > program perf

bug#8938: make timeout and CTRL-C

2011-07-02 Thread Alan Curry
shay shimony writes: > > > With this patch the child is guaranteed to not be in the foreground (as far > > as the tty knows) so it will be getting SIGTTIN and possibly SIGTTOU on tty > > operations. > > You may need to correct me. In practice we see that the "timeouted" program > perform successf

bug#8938: make timeout and CTRL-C

2011-07-02 Thread shay shimony
> With this patch the child is guaranteed to not be in the foreground (as far > as the tty knows) so it will be getting SIGTTIN and possibly SIGTTOU on tty > operations. You may need to correct me. In practice we see that the "timeouted" program perform successfully writes to the terminal, though

bug#8938: make timeout and CTRL-C

2011-06-29 Thread Pádraig Brady
On 28/06/11 20:10, Alan Curry wrote: > =?ISO-8859-1?Q?P=E1draig_Brady?= writes: >> >> I'm still not convinced we need to be messing with tcsetpgrp() >> but you're right in that the disconnect between the timeout >> process group and that of whatever starts `timeout` should be bridged. >> >> I'm tes

bug#8938: make timeout and CTRL-C

2011-06-28 Thread Pádraig Brady
On 28/06/11 21:32, Alan Curry wrote: > Bob Proulx writes: >> >> P=E1draig Brady wrote: >>> Paul Eggert wrote: I'd like to have an option to 'timeout' so that it merely calls alarm(2) and then execs COMMAND. This would be simple and fast would avoid the problem in question. This

bug#8938: make timeout and CTRL-C

2011-06-28 Thread Bob Proulx
Alan Curry wrote: > That sounds reasonable, but then if something is about to be killed by > timeout, there's reason to believe it's not behaving well at the moment. Not necessarily. For example many things depend upon something across the network. If the network wire is unplugged then they migh

bug#8938: make timeout and CTRL-C

2011-06-28 Thread Alan Curry
Bob Proulx writes: > > P=E1draig Brady wrote: > > Paul Eggert wrote: > > > I'd like to have an option to 'timeout' so that > > > it merely calls alarm(2) and then execs COMMAND. > > > This would be simple and fast would avoid the problem > > > in question. This approach has its own issues, but >

bug#8938: make timeout and CTRL-C

2011-06-28 Thread Bob Proulx
Pádraig Brady wrote: > Paul Eggert wrote: > > I'd like to have an option to 'timeout' so that > > it merely calls alarm(2) and then execs COMMAND. > > This would be simple and fast would avoid the problem > > in question. This approach has its own issues, but > > when it works it works great, and

bug#8938: make timeout and CTRL-C

2011-06-28 Thread Alan Curry
=?ISO-8859-1?Q?P=E1draig_Brady?= writes: > > I'm still not convinced we need to be messing with tcsetpgrp() > but you're right in that the disconnect between the timeout > process group and that of whatever starts `timeout` should be bridged. > > I'm testing the attached patch at the moment (whic

bug#8938: make timeout and CTRL-C

2011-06-28 Thread shay shimony
Thanks for taking care for this! Interesting stuff as well. 2011/6/28 Pádraig Brady > On 27/06/11 21:12, Alan Curry wrote: > > =?UTF-8?Q?P=C3=A1draig?= Brady writes: > >> > >> On 26/06/11 20:20, shay shimony wrote: > >>> all: > >>> timeout 12 sleep 10 > >>> > >>> Note there is a tab bef

bug#8938: make timeout and CTRL-C

2011-06-28 Thread Pádraig Brady
On 27/06/11 23:55, Alan Curry wrote: > =?UTF-8?Q?P=C3=A1draig?= Brady writes: >> >> This is a multi-part message in MIME format. >> --03030307000505070101 >> Content-Type: text/plain; charset=ISO-8859-1 >> Content-Transfer-Encoding: 8bit >> >> On 27/06/11 21:12, Alan Curry wrote: >>

bug#8938: make timeout and CTRL-C

2011-06-28 Thread Pádraig Brady
On 28/06/11 19:19, Paul Eggert wrote: > I'd like to have an option to 'timeout' so that > it merely calls alarm(2) and then execs COMMAND. > This would be simple and fast would avoid the problem > in question. This approach has its own issues, but > when it works it works great, and it'd be a nice

bug#8938: make timeout and CTRL-C

2011-06-28 Thread Paul Eggert
On 06/28/11 11:41, Pádraig Brady wrote: > The main problem with that is would only > send the signal to the first process, and > any processes it started would keep running. Yes, that's the main issue with it. Still, it's handy for programs where you either know it doesn't use subprocesses, or yo

bug#8938: make timeout and CTRL-C

2011-06-28 Thread Paul Eggert
I'd like to have an option to 'timeout' so that it merely calls alarm(2) and then execs COMMAND. This would be simple and fast would avoid the problem in question. This approach has its own issues, but when it works it works great, and it'd be a nice option.

bug#8938: make timeout and CTRL-C

2011-06-27 Thread Alan Curry
=?UTF-8?Q?P=C3=A1draig?= Brady writes: > > This is a multi-part message in MIME format. > --03030307000505070101 > Content-Type: text/plain; charset=ISO-8859-1 > Content-Transfer-Encoding: 8bit > > On 27/06/11 21:12, Alan Curry wrote: > > > > What seems to be happening is that ma

bug#8938: make timeout and CTRL-C

2011-06-27 Thread Pádraig Brady
On 27/06/11 21:12, Alan Curry wrote: > =?UTF-8?Q?P=C3=A1draig?= Brady writes: >> >> On 26/06/11 20:20, shay shimony wrote: >>> all: >>> timeout 12 sleep 10 >>> >>> Note there is a tab before "timeout 12 sleep 10". >>> Then run at same directory where the file is located "make" and try to pr

bug#8938: make timeout and CTRL-C

2011-06-27 Thread Alan Curry
=?UTF-8?Q?P=C3=A1draig?= Brady writes: > > On 26/06/11 20:20, shay shimony wrote: > > all: > > timeout 12 sleep 10 > > > > Note there is a tab before "timeout 12 sleep 10". > > Then run at same directory where the file is located "make" and try to press > > CTRL-C. > > > > Notes: > > CTR

bug#8938: make timeout and CTRL-C

2011-06-27 Thread Pádraig Brady
On 26/06/11 20:20, shay shimony wrote: > Hello coreutils team, > > I found that if you run timeout inside make file then CTRL-C doesn't work. > Really frustrating because I use timeout to terminate deadlocked tests, but > can't stop them with CTRL-C as I used to. > > To reproduce copy the followi

bug#8938: make timeout and CTRL-C

2011-06-26 Thread shay shimony
Hello coreutils team, I found that if you run timeout inside make file then CTRL-C doesn't work. Really frustrating because I use timeout to terminate deadlocked tests, but can't stop them with CTRL-C as I used to. To reproduce copy the following into file named Makefile: all: timeout 12