X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Thorsten Kampe Subject: Re: Bash process hangs around forever after ssh disconnect Date: Sun, 23 Nov 2008 17:50:51 +0100 Lines: 41 Message-ID: References: <4928624D DOT 8090800 AT Hipp DOT com> <492980CF DOT 9000408 AT Hipp DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit User-Agent: MicroPlanet-Gravity/2.70.2067 X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com * Michael Hipp (Sun, 23 Nov 2008 10:11:59 -0600) > Thorsten Kampe wrote: > > * Michael Hipp (Sat, 22 Nov 2008 13:49:33 -0600) > >> I'm logging in to a W2k server via cygwin sshd and using Putty as my > >> terminal emulator. If my ssh connection gets dropped for any reason > >> the bash.exe process on the host just stays there forever. Also, > >> anything I was running in bash (e.g. vim) will stay there forever. I'm > >> having to use taskman to clean this up periodically. > >> > >> Anything that can be done about this? > > > > You could check or set you the ClientAliveInterval and TCPKeepAlive. > > I've set both to 0 respectively to no because I don't want sshd to kill > > my session only because the client does not respond for a while. Use > > "screen" to reconnect when the connection is back. > > Thanks. I set these options as per the man page and after restarting the sshd > service it has had no effect on the problem. Appears it may be more related to > bash than sshd per this... > > - When the system is idle I have one (1) sshd.exe process (the service). > > - Once I log in remotely I have two (2) sshd.exe processes and one (1) > bash.exe process. That's the Windows/Cygwin emulation of a Unix fork. Should be the same as on Linux. > > - When I force exit the client terminal emulator one of the sshd.exe > processes goes away almost immediately. But the one bash.exe process is still > there (even as much as hours or days later). > > Appears there's some lack of understanding between sshd and bash. Please read again what I wrote and try to understand it. In all likelihood you do NOT want sshd to kill your shell because you loose connection for a while. Let me repeat: you do NOT want that. You want the ability to reconnect to that session once the physical connection is reestablished. "screen" gives you that ability. Thorsten -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/