Job gets stopped when typing on terminal

Steps to reproduce:

Expected behaviour: The process carries on working.

Actual behaviour: If you press Enter, you get this:

[1]+  Stopped                 pola-run -B --x11 -e xeyes

If you strace pola-run, you will find that it is blocked on read(). The problem is that when you enter input via the tty, poll() tells pola-run that there is input waiting. But pola-run is not in the right progress group to read the input from the tty FD, and the read() call causes the whole process group to receive a stop signal. This stops all the processes in the process group from running until you foreground the process group from the shell.

This is one of the cases in which file descriptors do not behave like capabilities (see FileDescriptorsAsCapabilities).

Workaround

Redirect stdin to /dev/null, e.g.

pola-run -B --x11 -e xeyes </dev/null &

Questions

Can we fix this by setting the signal handler for SIGTTIN to SIG_IGN?

PlashIssues/JobStoppedOnInput (last edited 2008-08-24 20:14:24 by MarkSeaborn)