delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/09/07/08:11:23

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <F15DCDDFC247D011A0B20000F84A170F05B23181@mante10.nam.dow.com>
From: "Habermann, David (DA)" <habermann AT dow DOT com>
To: "'Corinna Vinschen'" <cygwin AT cygwin DOT com>
Subject: RE: Feature request: inetd as a service on win98
Date: Fri, 7 Sep 2001 08:10:45 -0400
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)

>On Fri, Sep 07, 2001 at 10:10:45AM +0200, Gerald Villemure wrote:
>> In other words run inetd as a true service in win98 such that I can login
>> and logout without affecting the inetd process.  Somewhat like the VNC
>> server dose.
>> 
>> One option perhaps would be to introduce a new command in cygwin to hide
a
>> window based on PID with the option to also detach it from the session so
>> the person can log out without a dialog popping up saying you need to
close
>> all your apps first.
>
>Just a question:  Why don't you contribute such a solution to
>our community driven open source project called Cygwin?

In case it helps, I found that addition of the following code bit
(originally 
found as part of the VNC project) to SSHD allows it to detach from the DOS 
window in which it was running, allowing the DOS window to be closed 
on Win98.  Sorry that I'm not providing this in the standard patch form, but

no one has ever taught me how to create one.

List of source modifications to sshd.c

****************************************************************************
****

#include "authfile.h"
#include "windows.h" /* DAH modification to add FreeConsole */

****************************************************************************
****

		if (daemon(0, 0) < 0)
			fatal("daemon() failed: %.200s", strerror(errno));

		/* begin DAH modification to detach and run in background */
    		fflush(stdin);
    		fflush(stdout);
    		fflush(stderr);

    		/* Detach from the console */

    		if (!FreeConsole())
    		{
			debug("failed to detach from console");
    		}
		/* end DAH modification */

		/* Disconnect from the controlling tty. */

****************************************************************************
****

Dave Habermann

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.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