On 6/11/17 10:24 PM, Clark Wang wrote:
> On Mon, Jun 12, 2017 at 5:48 AM, Chet Ramey <chet.ra...@case.edu
> <mailto:chet.ra...@case.edu>> wrote:
> 
>     On 6/10/17 10:19 AM, Clark Wang wrote:
> 
>     > If I kill the "ssh -o ControlMaster=no -o ControlPath=/tmp/socket.tmp
>     > 127.0.0.1 sleep 9999" then tty #1 (pts/11) would be able to accept my 
> input
>     > again. Seems like the background "ssh" at tty #1 is consuming all 
> input. I
>     > cannot understand this since it should be stopped by SIGTTIN if it 
> tries to
>     > read from the tty.
> 
>     This has come up before. You need to use `ssh -n' to avoid it reading from
>     stdin. Processes can ignore SIGTTIN, and ssh does so to avoid being 
> stopped
>     if it reads from the tty while in the background.
> 
> 
> I've checked the ssh process and it does not catch SIGTTIN and that's why
> I'm confused.

OK. This has gone beyond the realm of a bash bug. I'm pretty sure that
previous versions of ssh ignored or caught SIGTTIN, but it must not do that
now.

Since ssh has a handle on its controlling terminal, it must do something
that allows it to read from it even if it's not in the foreground process
group. In any event, -n is the way to deal with that.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://cnswww.cns.cwru.edu/~chet/

Reply via email to