Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
Date: Thu, 26 Apr 2001 18:15:03 -0400
From: Christopher Faylor <cgf@redhat.com>
To: cygwin@cygwin.com
Subject: Re: Cygwin service doesn't get NT shutdown notification
Message-ID: <20010426181503.C360@redhat.com>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <20010426113527.A99410@enteract.com> <3AE8215E.30294.3E93F1@localhost>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.3.11i
In-Reply-To: <3AE8215E.30294.3E93F1@localhost>; from pgarceau@qwest.net on Thu, Apr 26, 2001 at 01:23:42PM -0700

On Thu, Apr 26, 2001 at 01:23:42PM -0700, Paul Garceau wrote:
>On 26 Apr 2001, at 11:35, the Illustrious Fred Yankowski wrote:
>>I'm trying to write a wrapper for the Cygwin port of PostgreSQL so that
>>it can run as an NT service and stop cleanly when the service is
>>stopped or shutdown due to system shutdown.  I've got it working well
>>when the service is stopped manually, but when I shutdown/restart my NT
>>system the service process seems to get killed without being notified
>>of the shutdown.
>>
>>I've written a simple NT service that can be built for both Cygwin and
>>native NT (based on code from Corinna Vinschen, Chuck Wilson, and Jason
>>Tishler).  The native Win32 version *does* catch and handle the
>>shutdown event, but the same code built for Cygwin does not seem to get
>>the event.
>
>Just guessing, but are you including a specific message handling
>subroutine/module geared to interface between the Cygwin (bash) shell
>and the NT4 (comspec) shell?  Without being able to draw from
>experience (another guess -- hopefully an educated one), there is a
>possibility that Cygwin registry settings are overwriting PostGreSQL
>registry settings, thereby corrupting your NT4 registry when it comes
>to shut down (system shut down/restart).

I have no idea what registry settings would have to do with this.  Why
would Cygwin's manipulation of the registry (which should only happen
when you mount or umount stuff) interfere with anything else?

I assume that this problem actually has something to do with the way
Cygwin handles signals and the way it traps things like "shutdown
events".

Inspection of Cygwin code would probably be pretty enlightening in
that regard.

It's possible that just setting a SIGHUP handler will be adequate to fix
this problem.

cgf

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

