--=-6evjGHD+D17WUG/8qZfc Content-Type: text/plain Content-Transfer-Encoding: 7bit
On Fri, 2005-03-18 at 11:19 +0200, Ilya Konstantinov wrote: > shimi wrote: > > >Maybe try to think what programs you used when this happend (Although > >this is clearly a bug in sshd/ssh, and NOT in the programs. No matter > >what a program does, leaving a session and proper cleanup are up to the > >process that handles the session IMHO). > > > It's NOT a bug in sshd. Ctrl-D is simply a way to tell your shell (which > is only one of the processes using the pty which sshd allocated) to > exit. If there are othere processes using that pty, they're as much of a > reason to keep the SSH connection alive as your shell program was -- SSH > doesn't know what's a shell and what isn't. It cannot know that, by > terminating a /bin/bash process, you meant to close the entire connection. > > > It's only by merit of the /bin/bash process being the last process to > use that PTY that your connection usually closes as a result of a Ctrl-D. Well, I see it that way: If you kill a process, all the processes that were spawned by it are being killed as well [or supposed to be]. This, of course, isn't true about background processes (which is not necessarily our case). You can call it a feature, that SSH holds the pty open, but... I suspect most [all?] people would want that when the shell is closed, it will behave just like it does when you're on the local console (where the mentioned phenomenon doesn't happen, AFAIK). Since sshd is the one doing fork()/execve() for the shell, it CAN use wait(pid) (instead of checking the allocated pty pool) to see when the shell terminates, and then kill the session, IMHO. Shimi. -- shimi <[EMAIL PROTECTED]> --=-6evjGHD+D17WUG/8qZfc Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN"> <HTML> <HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8"> <META NAME="GENERATOR" CONTENT="GtkHTML/3.2.5"> </HEAD> <BODY> On Fri, 2005-03-18 at 11:19 +0200, Ilya Konstantinov wrote: <BLOCKQUOTE TYPE=CITE> <PRE> <FONT COLOR="#000000">shimi wrote:</FONT> <FONT COLOR="#000000">>Maybe try to think what programs you used when this happend (Although</FONT> <FONT COLOR="#000000">>this is clearly a bug in sshd/ssh, and NOT in the programs. No matter</FONT> <FONT COLOR="#000000">>what a program does, leaving a session and proper cleanup are up to the</FONT> <FONT COLOR="#000000">>process that handles the session IMHO).</FONT> <FONT COLOR="#000000">></FONT> <FONT COLOR="#000000">It's NOT a bug in sshd. Ctrl-D is simply a way to tell your shell (which </FONT> <FONT COLOR="#000000">is only one of the processes using the pty which sshd allocated) to </FONT> <FONT COLOR="#000000">exit. If there are othere processes using that pty, they're as much of a </FONT> <FONT COLOR="#000000">reason to keep the SSH connection alive as your shell program was -- SSH </FONT> <FONT COLOR="#000000">doesn't know what's a shell and what isn't. It cannot know that, by </FONT> <FONT COLOR="#000000">terminating a /bin/bash process, you meant to close the entire connection.</FONT> <FONT COLOR="#000000">It's only by merit of the /bin/bash process being the last process to </FONT> <FONT COLOR="#000000">use that PTY that your connection usually closes as a result of a Ctrl-D.</FONT> </PRE> </BLOCKQUOTE> <BR> Well, I see it that way:<BR> <BR> If you kill a process, all the processes that were spawned by it are being killed as well [or supposed to be]. This, of course, isn't true about background processes (which is not necessarily our case). You can call it a feature, that SSH holds the pty open, but... I suspect most [all?] people would want that when the shell is closed, it will behave just like it does when you're on the local console (where the mentioned phenomenon doesn't happen, AFAIK). Since sshd is the one doing fork()/execve() for the shell, it CAN use wait(pid) (instead of checking the allocated pty pool) to see when the shell terminates, and then kill the session, IMHO.<BR> <BR> Shimi.<BR> <BR> <TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%"> <TR> <TD> -- <BR> shimi <<A HREF="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</A>> </TD> </TR> </TABLE> </BODY> </HTML> --=-6evjGHD+D17WUG/8qZfc-- ================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]