Feature request: inetd as a service on win98

Habermann, David (DA) habermann@dow.com
Fri Sep 7 05:10:00 GMT 2001


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



More information about the Cygwin mailing list