Why openssh newer than 2.9.9 doesn't send SIGTERM and SIGHUP to child process?

Darren Tucker dtucker at zip.com.au
Mon Oct 14 21:26:04 EST 2002


Markus Friedl wrote:
[about sending HUP to sshd's child process]

I've found that using connect rather than nc solves my problem (connect
shuts down cleanly when stdin closes), but I'm still trying to
understand the reasoning here, so please bear with me.

> because it was wrong (telnetd, rlogind don't do it)

telnetd and rlogind assign a pty. rshd doesn't and has the same problem
as sshd w/o a pty.

> and dangerous (sending signals as root to other processes).

Is your objection because the pid may have been reused by an unrelated
process or something else?

> the login shells should die if their stdin/out is closed.

In my case it isn't a login shell, it's a sh -c and on Solaris, at
least, /bin/sh doesn't die.
If the shell is bash, it execs the command and no longer even exists.

> did you check the cvs log for this change?

revision 1.153
date: 2001/10/12 01:35:06;  author: djm;  state: Exp;  lines: +11 -18
 - (djm) OpenBSD CVS Sync
   - markus at cvs.openbsd.org 2001/10/10 22:18:47
     [channels.c channels.h clientloop.c nchan.c serverloop.c]
     [session.c session.h]
     try to keep channels open until an exit-status message is sent.
     don't kill the login shells if the shells stdin/out/err is closed.
     this should now work:
     ssh -2n localhost 'exec > /dev/null 2>&1; sleep 10; exit 5'; echo ?

-- 
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
    Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.



More information about the openssh-unix-dev mailing list