delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/12/09/16:03:06

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
content-class: urn:content-classes:message
MIME-Version: 1.0
Subject: RE: 1.5.12: ssh hangs with Windows XP SP2
Date: Thu, 9 Dec 2004 13:02:49 -0800
Message-ID: <3A83D9BECDDF58468F068F6CA1C36AB90288A855@corpmail.corp.netledger.com>
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
From: "Waiss, Garrett" <GWaiss AT netsuite DOT com>
To: <cygwin AT cygwin DOT com>
X-IsSubscribed: yes
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id iB9L35Ym014635

Unfortunately, -n doesn't help. I actually looked in the archives under
"ssh hangs" and read the various messages. I am really hoping that there
will a resolution for the pipe issue. Thanks for the response.

Garrett

-----Original Message-----
From: cygwin-owner AT cygwin DOT com [mailto:cygwin-owner AT cygwin DOT com] On Behalf
Of Igor Pechtchanski
Sent: Thursday, December 09, 2004 10:42 AM
To: Waiss, Garrett
Cc: cygwin AT cygwin DOT com
Subject: Re: 1.5.12: ssh hangs with Windows XP SP2


On Wed, 8 Dec 2004, Waiss, Garrett wrote:

> Cygwin version: 1.5.12
> OS: Windows XP SP2
>
> Before applying the SP2, ssh was working fine. Now ssh will hang with 
> this specfic case.
>
> This works:
> sh -c "ssh -i c:/keys/id_foo foo AT bong 'ls -l /opt/'"
>
> However, putting this into a java class for instance will cause this 
> to
> hang:
>
> <code>
> import java.io.*;
>
> public class test {
>    public static void main(String[] args) {
>       try {
>          final String cmd = "/bin/ssh -p 22 -i c:/keys/id_foo foo AT bong
'ls -l /opt'";
>          final Process p = Runtime.getRuntime().exec(new String[] {
>             "sh", "-c", cmd
>          });
>          final InputStreamReader isr = new
InputStreamReader(p.getInputStream());
>          final BufferedReader br = new BufferedReader(isr);
>          String line;
>          final StringBuffer sb = new StringBuffer(0);
>          while((line = br.readLine()) != null) {
>             sb.append(line);
>             sb.append('\n');
>          }
>          System.out.println(sb.toString());
>       }
>       catch (Exception e) {
>          System.out.println(e.getMessage());
>       }
>    }
> }
> </code>
>
> Is there a solution to this problem?

It's usually recommended to invoke remote commands that don't require
input with the "-n" ssh flag, which will close stdin -- try that.  If it
doesn't help, this could be the problem with the new pipe code that's
been mentioned on this list -- search the web archives for "ssh hangs".
HTH,
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"The Sun will pass between the Earth and the Moon tonight for a total
Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT

--
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/


--
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/


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019