bug#15779: timeout: Child gets SIGTTOU when run from a shell script
From:
Richard W.M. Jones
Subject:
bug#15779: timeout: Child gets SIGTTOU when run from a shell script
Date:
Fri, 1 Nov 2013 12:17:37 +0000
User-agent:
Mutt/1.5.20 (2009-12-10)
On Fri, Nov 01, 2013 at 11:53:44AM +0000, PƔdraig Brady wrote:
> Probably something to do with job control
> If you `set -m` first in the script,
> then the test binary doesn't hang.
Unfortunately set -m isn't quite right for the script
we are interested in fixing:
https://github.com/libguestfs/libguestfs/blob/master/run.in#L217
> I did a version of timeout once that put the child in it's own group,
> and noted in that version that I needed to leave SIGTTOU as IGN
> as tcsetpgrp(0, getpid()) caused SIGTTOU to be sent and I wasn't sure why.
That sounds like a very similar situation to this one. The
tty_check_change function is called all over the place, so just about
any ioctl or flush or tc* function could cause SIGTTOU to be sent.
> Maybe we should be resetting SIGTT{OU,IN} to what it was
> previously set to, rather than SIG_DFL?
The attached patch does *not* work .. don't know if you can see
any obvious mistakes.
Yesterday I looked through the strace -f output between the two cases
and came to the conclusion that it's not about signal handlers at all.
(What it's about is a mystery ...)
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine. Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/