Re: Service reboot leaves postmaster.pid

From: Fred Yankowski <fred(at)ontosys(dot)com>
To: "Henshall, Stuart - WCP" <SHenshall(at)westcountrypublications(dot)co(dot)uk>
Cc: "'pgsql-cygwin(at)postgresql(dot)org'" <pgsql-cygwin(at)postgresql(dot)org>
Subject: Re: Service reboot leaves postmaster.pid
Date: 2001-06-14 15:27:51
Message-ID: 20010614102751.A70357@enteract.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-cygwin

I've seen this same problem when using a patched version of postmaster
that directly incorporates the service-management functions also
provided by cygrunsrv. I eventually got around the problem by
changing the postmaster and postgres code to ignore the SIGHUP signal.

SIGHUP normally causes postmaster to reread its configuration file.
Unfortunately, cygwin code linked into postmaster catches a
window-shutdown event during NT shutdown and sends a SIGHUP signal to
its own process, causing postmaster to start up its process of
rereading the config file. Something about this coincidence causes
postmaster to end up in the state where postmaster.pid is still
around after restart. I suspect that the reconfiguration process
hangs or is aborted during shutdown.

I'm planning to submit a patch to cygrunsrv that will give it an
optional feature to notice the event of NT shutdown and send a signal
to the managed process, much as is done for a manual stop with the
'--termsig' option. This will allow us to do the equivalent of
'pg_ctl -m fast stop' or 'pg_ctl -m immediate stop' at that time. But
my experiences with a prototype suggest that it's still necessary to
ignore SIGHUP in postmaster and postgres in that case because SIGHUP
can otherwise still interfere with shutdown.

On Thu, Jun 14, 2001 at 01:16:00PM +0100, Henshall, Stuart - WCP wrote:
> I'm running the postmaster as a service using cygrunsrv and this
> seems to go fine apart from when I reboot it doesn't seem to remove the
> postmaster.pid file, meaning it fails to start automatically after reboot.

--
Fred Yankowski fred(at)OntoSys(dot)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

In response to

Browse pgsql-cygwin by date

  From Date Subject
Next Message Pat Hardy 2001-06-15 01:54:19 Re: Cannot build JDBC driver for PostgreSQL 7.12 on NT
Previous Message Henshall, Stuart - WCP 2001-06-14 14:53:18 RE: Very urgent