Re: postgresql as a winNT/2k service??? - Mailing list pgsql-ports

From Fred Yankowski
Subject Re: postgresql as a winNT/2k service???
Date
Msg-id 20010414105015.A98063@enteract.com
Whole thread Raw
In response to postgresql as a winNT/2k service???  ("JC" <fabrejc@ensam.inra.fr>)
List pgsql-ports
On Fri, Apr 13, 2001 at 03:22:32PM +0200, JC wrote:
> I've installed cygwin+postgreSQL 7.1rc4 on my Win2kServer box.
> It works fine
> But I would like to know how to run the postmaster as a service...

I'm working on adding that capability:  See
<http://greatbridge.org/project/pgntservice/projdisplay.php>.

However, I'm currently stuck on a critical problem:  when I restart my
NT4 system, the mechanism for doing a clean PostgreSQL shutdown is not
working; the postgres processes seem to be killed abruptly as if they
had received the NT equivalent of SIGKILL.  I've set up the main
postmaster process, the one that interacts with the NT Service Control
Manager, to accept and handle the SERVICE_CONTROL_SHUTDOWN event.  But
it seems that that process never gets that event.

This problem has something to do with Cygwin itself, not PostgreSQL.
Thanks to some help from Jason Tishler, I've got an example of a
trivial NT service process that does handle the shutdown event
properly when built with MS VC++.  However, if I build the same code
with Cygwin, the service runs but does _not_ get the shutdown event.
It does react properly to the regular "stop" event sent by the "net
stop" command.

If anyone has _any_ clues about how to attack this problem, I'm
interested.

--
Fred Yankowski           fred@OntoSys.com      tel: +1.630.879.1312
Principal Consultant     www.OntoSys.com       fax: +1.630.879.1370
OntoSys, Inc             38W242 Deerpath Rd, Batavia, IL 60510, USA

pgsql-ports by date:

Previous
From: Jason Tishler
Date:
Subject: Re: running
Next
From: Tulassay Zsolt
Date:
Subject: Re: initdb problem