[Bug 396] sshd orphans processes when no pty allocated

bugzilla-daemon at bugzilla.mindrot.org bugzilla-daemon at bugzilla.mindrot.org
Thu Jun 11 04:29:56 EST 2009


https://bugzilla.mindrot.org/show_bug.cgi?id=396


Marc Herbert <marc.herbert+mindrot at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marc.herbert+mindrot at gmail.
                   |                            |com




--- Comment #14 from Marc Herbert <marc.herbert+mindrot at gmail.com>  2009-06-11 04:29:55 ---
(In reply to comment #9)

> Bug #52 is sshd waiting for descriptors to close on a clean shutdown.  This one
> is subprocesses not knowing that sshd (and thus their stdin/stdout) has gone
> away on abnormal termination, usually because they don't check if their read()
> calls on stdin return zero.

People like me not comfortable with patching their ssh server can
probably take advantage of this workaround I wrote. This is just a "EOF
to SIGHUP" converter implemented in 4 lines of shell script (it simply
inserts a "cat" between sshd and the no longer orphan process).

TUBE=/tmp/myfifo.$$; mkfifo "$TUBE"
<"$TUBE"   yourApplicationIgnoringEOFMoreOftenThanNot   &  appPID=$!
# unlike the above, cat WILL notice the EOF and politely die
cat >"$TUBE"
kill -HUP -$appPID; rm "$TUBE"

Feedback is welcome; do not hesitate to email me.

-- 
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are watching the reporter.


More information about the openssh-bugs mailing list