Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Sun, 13 Nov 2005 16:06:23 -0500 (EST) From: Igor Pechtchanski Reply-To: cygwin AT cygwin DOT com To: Christian Franke cc: cygwin AT cygwin DOT com Subject: Re: setsid() does not call FreeConsole() even if all files are closed In-Reply-To: <4377651F.9050400@t-online.de> Message-ID: References: <4377651F DOT 9050400 AT t-online DOT de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; FORMAT=flowed Content-ID: On Sun, 13 Nov 2005, Christian Franke wrote: > when starting a daemon from the console, the console will not close > before the daemon finishes. > > Try, e.g: > > $ /usr/sbin/syslogd > $ exit > > Shell exits, but console window persists until syslogd is terminated. > > Workaround: > > setsid(); > + #ifdef __CYGWIN__ > + FreeConsole(); > + #endif > > According to syscall.cc:setsid(), FreeConsole() should be called if a > tty exists and no files are open. Yep, so, as CGF noted, try $ /usr/sbin/syslogd >/dev/null 2>&1