SSH Doesn't Close stdio/err When Backgrounded

Dino Klein dinoklein at
Thu May 25 05:38:49 EST 2006


I've recently started employing the opportunistic multiplexing feature, and 
I've come across what seems like a bug.

Here's how it goes: in Fedora Core 5 I run the Gnome terminal application, 
and open two terminals (two tabs). In the first terminal I initiate an ssh 
connetion that becomes the master for multiplexing; in the second terminal I 
open a second terminal session to the same host. After this, I background 
the master on the first terminal via "~&"; even though the process forked, 
it still had the I/O/Err descriptors open according to /proc/$PID/fd.

Now, the funny part - if I run ssh in first terminal with the same target 
host, it opens the connection through the master, but I cannot do anything 
since the input seems to be hijacked by the backgrounded master. This does 
not manifest itself if I do anything else locally, eg running ls or vi.

Furthermore, after goning through the input-hijacking mention above, the 
backgrounded master won't terminate even after all connection through it 
finish (even after killing the defunt session which has no input).

Also, this is reproducible.

More information about the openssh-unix-dev mailing list