Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
X-Injected-Via-Gmane: http://gmane.org/
To: cygwin@cygwin.com
From: Joe Buehler <jbuehler@hekimian.com>
Subject: Cygwin rsh/socket bug?
Date: Tue, 03 Jun 2003 14:38:35 -0400
Organization: Spirent Communications, Inc.
Lines: 21
Message-ID: <bbipr0$ldg$1@main.gmane.org>
References: <bbie58$m65$1@main.gmane.org>
Reply-To: jbuehler@hekimian.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: usenet@main.gmane.org
User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.4b) Gecko/20030507
X-Accept-Language: en-us, en
In-Reply-To: <bbie58$m65$1@main.gmane.org>
X-Enigmail-Version: 0.75.0.0
X-Enigmail-Supports: pgp-inline, pgp-mime

> I cannot figure out how to get the job to detach -- the rsh always waits
> for the job to finish, which is not what I want.  I just want to fire up
> a command on a remote machine and forget about it.

E.g., the following hangs:

   rsh cygwin-machine 'some_command </dev/null >/dev/null 2>&1 &'

(If I got something slightly wrong there, keep in mind that it's an
example so you can see what I mean -- I am actually using a script that I
have used for years on UNIX machines.)

I got this to work properly by wrapping the remote command with a PERL script
that invokes shutdown() on STDIN, STDOUT and STDERR and then close().

I assume this is some kind of bug in Cygwin or in.rshd -- all I have to
do on UNIX machines is close() on the same descriptors and the rsh client
disconnects as desired.
-- 
Joe Buehler



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

