From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27809 invoked by alias); 24 Aug 2011 13:31:27 -0000 Received: (qmail 27785 invoked by uid 22791); 24 Aug 2011 13:31:04 -0000 X-Spam-Check-By: sourceware.org Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.83/v0.83-20-g38e4449) with ESMTP; Wed, 24 Aug 2011 13:30:46 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id 9C4702C00F3; Wed, 24 Aug 2011 15:30:43 +0200 (CEST) Date: Wed, 24 Aug 2011 13:31:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: Cygwin shells closing when launched by a telnet server client in Windows 7 Message-ID: <20110824133043.GJ13527@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2011-08/txt/msg00456.txt.bz2 On Aug 22 13:46, Clayton Evans wrote: > I am in the process of upgrading to a new machine. This machine is > used as a compute server, where users telnet to the machine, start up > a Korn shell and run compute intensive programs from the Korn shell. > The current machine is running Cygwin 1.5 and Windows XP 64 bit. This > process has worked for years. The new machine is running Cygwin 1.7 > and Windows 7 64 bit. After telneting to the new machine, mksh.exe > appears to start after some pause, show it's prompt and then exits, > returning to the command prompt within the telnet session. This > behavior makes me think that no input stream is getting connected to > the shell and the shell exits. First of all, don't use telnet. Use ssh. There's an openssh package in the distro which provides an sshd server. > Both machines are using Microsoft's Telnet Service. I have tried > ash.exe, bash.exe, dash.exe and sh.exe. All the shell programs show > their input prompt and then exit to the command prompt > C:\cygwin\bin>mksh.exe -l -i > user@hostname ~ > $ > > C:\cygwin\bin> > The shell commands work fine, when one is locally on the compute > server. I have tried HyperTerminal, putty.exe and Microsoft's telnet > client on the client machine and they all give the same result. > There are no entries in the Windows 7 event log. > The Korn shell is working non-interactively when telneted as > demonstrated below by having the Korn shell execute a command specific > to the Korn shell. > C:\cygwin\bin>mksh.exe -c "whence whence" > whence > > C:\cygwin\bin> > I have tried setting the Korn shell to be terminal server aware, > peflags -tsaware=true mksh.exe, with no change in the results. That flag has nothing to do with this problem. However, I have no idea how to help with telnet. I tried to track this down, and it turns out that a perfectly valid call to WaitForMultipleObjects with the telnet stdin handle returns with an error "Invalid Handle", while WriteFile to the telnet pipe performed by the first Cygwin process in a process tree can break the connection. You say it worked in 1.5, but I don't see a difference in the handling of the incoming stdio handles between 1.5 and 1.7 which would explain that behaviour. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple