[Bug 223] ProxyCommand commands don't exit

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Sat May 25 18:39:31 EST 2002


http://bugzilla.mindrot.org/show_bug.cgi?id=223





------- Additional Comments From dtucker at zip.com.au  2002-05-25 18:39 -------
It works but still leaves an orphaned nc (on Solaris anyway):

$ ssh -o 'ProxyCommand exec nc localhost 22' localhost echo

$ ps -eaf | grep nc
dtucker  9919  9049  0 18:23:45 pts/2    0:00 grep nc
dtucker  9912     1  1 18:23:40 pts/2    0:00 nc localhost 22

After some more investigation I think there's 2 issues:
1) On all platforms, the child process isn't signalled when ssh exits, leaving
them orphaned.
2) On Solaris (and possibly other platforms), running the ProxyCommand without
"exec" also leaves an extra "sh -c". Additionally, the "sh -c" ignores SIGHUP
and doesn't propogate SIGTERM, so even if ssh kills its child you're still left
with 1 orphan rather than 2.

FWIW, I've been working on a better patch that fixes 1 by always using exec and 
fixes 2 by sending SIGHUP (then SIGTERM then SIGKILL) to the child. This seems
to be a clean solution.

I'm cleaning the patch up for posting now.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the openssh-unix-dev mailing list