delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/04/09/12:04:53

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:reply-to:message-id:to:subject
:mime-version:content-type:content-transfer-encoding; q=dns; s=
default; b=AWZiYngWKB86j11HmcpYqFpw+/Q/TfNa5fhY5H+ly/VRLRfV03qfp
0QYAMRrbmriEcZ6BJuJmeiBaOr8AVlvIfXWdiVVq1T5QhtUkz9E62/hvhELwZqHT
3jt/XR2MlWgpPPSMC1oXUphxCHxU8k3Xkag5X4oI0+j91+IgKnPVZ8=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:reply-to:message-id:to:subject
:mime-version:content-type:content-transfer-encoding; s=default;
bh=ljjwN3HmRDvWp7RGxfyVggM3+tQ=; b=ZoUQRkjFYffCZwHnFR243/wsm3Jb
2Dc3qf4jRS3ZMLJmIFk8zA6YpCtG+YW1yELdfRdqT03dtRvpfoccS6OHhK03Xtru
u5rpy1DeYIh4OhhrIatSgdM3D4mBpzS5YPgB2z8M6lp+0RC/R+hwW6Cmc9LHmLJv
nl6Dn1y1cqR/JIA=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
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
X-Spam-SWARE-Status: No, score=-4.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,TW_MK autolearn=ham version=3.3.1
X-Received: by 10.112.163.6 with SMTP id ye6mr13937696lbb.59.1365523474200; Tue, 09 Apr 2013 09:04:34 -0700 (PDT)
Date: Tue, 9 Apr 2013 20:04:29 +0400
From: Ilya Basin <basinilya AT gmail DOT com>
Reply-To: Ilya Basin <basinilya AT gmail DOT com>
Message-ID: <471284393.20130409200429@gmail.com>
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: 'ssh -1 -L < named_pipe' freezes
MIME-Version: 1.0

Here's my script that works on linux:

    cmd="ssh -T -N -g -1 -L 10001:anotherhost:22"
    fifo=`mktemp -u`
    mkfifo "$fifo"
    $cmd <"$fifo" &
    exec 3>"$fifo"
    # message: Pseudo-terminal will not be allocated because stdin is not a terminal.
    # netstat shows that port 10001 is LISTENING
    # from another terminal: ssh -p 10001 localhost
    #printf '\0' >&3 # unfreeze on Cygwin
    wait

-N is ignored for protocol version 1, so as a workaround I redirect
input from an eternal pipe.
I want to save processes, so I'm using a named pipe instead of
something like:
    sleep | ssh

On Cygwin when I try to use the forwarded port, the new client freezes
until I write something to the pipe.

This happens only with named pipes. Normal pipes work well.


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

- Raw text -


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