delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/10/26/05:41: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: Running ssh in background [solution/patch]
Date: Wed, 26 Oct 2005 11:40:52 +0200
Message-ID: <F0D7281DAB048B438E8F5EC4ECEFBDDC506E10@esmail.elsag.de>
From: =?iso-8859-1?Q?J=F6rg_Schaible?= <Joerg DOT Schaible AT Elsag-Solutions DOT com>
To: <cygwin AT cygwin DOT com>
X-IsSubscribed: yes
Reply-To: cygwin AT cygwin DOT com
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id j9Q9f53s025800

Jörg Schaible wrote on Wednesday, October 26, 2005 10:09 AM:

> Alexander Gottwald wrote on Tuesday, October 25, 2005 6:26 PM:
> 
>> On Tue, 25 Oct 2005, Jörg Schaible wrote:
>> 
>>> Good guess. While I have no console window popping up anymore, the
>>> ssh process does now no longer terminate and the Windows app hangs
>>> until I kill the ssh process :(
>> 
>> most likely run.exe does not support piping or piping data to a
>> non-console application does not work at all.
>> 
>> Why do you need cygwin openssh? the subversion plugin does ssh
>> connections too. Maybe puttys plink is an alternative. TortoiseSVN
>> has a version which is compiled without console.
> 
> Because I work extensivly with Cygwin, have already the
> ssh-agent up and use different private keys to access various
> sites. I don't want to start another agent just because of
> putty and configuring Subversion to use 1 key only is not sufficient.

My solution was to build ssh as Windows console app:

diff -u openssh-4.2p1-1-orig/Makefile.in openssh-4.2p1-1/Makefile.in
--- openssh-4.2p1-1-orig/Makefile.in    2005-10-26 10:25:20.805291200 +0200
+++ openssh-4.2p1-1/Makefile.in 2005-10-26 10:58:19.390356800 +0200
@@ -60,7 +60,7 @@
 INSTALL_SSH_PRNG_CMDS=@INSTALL_SSH_PRNG_CMDS@
 INSTALL_SSH_RAND_HELPER=@INSTALL_SSH_RAND_HELPER@
 
-TARGETS=ssh$(EXEEXT) sshd$(EXEEXT) ssh-add$(EXEEXT) ssh-keygen$(EXEEXT) ssh-keyscan${EXEEXT} ssh-keysign${EXEEXT} ssh-agent$(EXEEXT) scp$(EXEEXT) ssh-rand-helper${EXEEXT} sftp-server$(EXEEXT) sftp$(EXEEXT)
+TARGETS=ssh$(EXEEXT) sshw$(EXEEXT) sshd$(EXEEXT) ssh-add$(EXEEXT) ssh-keygen$(EXEEXT) ssh-keyscan${EXEEXT} ssh-keysign${EXEEXT} ssh-agent$(EXEEXT) scp$(EXEEXT) ssh-rand-helper${EXEEXT} sftp-server$(EXEEXT) sftp$(EXEEXT)
 
 LIBSSH_OBJS=acss.o authfd.o authfile.o bufaux.o buffer.o \
        canohost.o channels.o cipher.o cipher-acss.o cipher-aes.o \
@@ -135,6 +135,9 @@
 ssh$(EXEEXT): $(LIBCOMPAT) libssh.a $(SSHOBJS)
        $(LD) -o $@ $(SSHOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
 
+sshw$(EXEEXT): $(LIBCOMPAT) libssh.a $(SSHOBJS)
+       $(LD) -mwindows -o $@ $(SSHOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
+
 sshd$(EXEEXT): libssh.a        $(LIBCOMPAT) $(SSHDOBJS)
        $(LD) -o $@ $(SSHDOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(LIBWRAP) $(LIBPAM) $(LIBS)
 

I create here an additional sshw.exe that sets the -mwindows linker switch. The result is still a Cygwin app that seems to work normally from the command line and works also called as background process without popping up a console window.

Two questions:

1/ Corinna, could you provide this version with next OpenSSH releases, too? Setting the appropriate property in the Subversion config to this sshw.exe, makes the SVN Clients in the Windows worlds happy. Neither Subclipse nor RapidSVN show these steadily popping up console windows anymore, nor does the command line version of Subversion behave differently.

2/ If linking a normal console app as Windows console app does not behave differently, why is it not the default? What's the real difference for Cygwin? It is still a Cygwin app and is normally listed in the Cygwin processes. I cannot say too much about the pipe and forking stuff, but something like "tar cf - *.sh | sshw spk1 tar xf -" works just normal.

- Jörg

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