Skip site navigation (1) Skip section navigation (2)

Re: how to shutdown postmaster as NT service?

From: Jason Tishler <Jason(dot)Tishler(at)dothill(dot)com>
To: Fred Yankowski <fred(at)ontosys(dot)com>
Cc: pgsql-ports(at)postgresql(dot)org
Subject: Re: how to shutdown postmaster as NT service?
Date: 2001-01-17 15:43:16
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-ports

On Fri, Jan 12, 2001 at 01:59:51PM -0600, Fred Yankowski wrote:
> If postmaster is installed as an NT service using the 'invoker'
> utility, how can arrange to shutdown that service gracefully when NT
> shuts down?

AFAICT, you can't.

An interesting (albeit hacky) solution can be found at:

This solution does *not* run postmaster as an NT service.  Instead a
fake service runs that execute a batch script that starts postmaster on
startup and another one that stops postmaster on shutdown.

> Perhaps invoker is too crude as a service manager for the postmaster
> process?  What alternatives do I have?  I've seen mention of srvany,
> but I have no idea how to use it.

srvany will not give you any extra functionality over invoker.  In fact,
it is part of Microsoft's Resource Kit, so it is not freely distributable.

> Can the postmaster (postgres.exe) program itself run as a service?

No (or not yet).

> I saw mention that someone was considering adding that capability, but I
> see no hint that it's there yet.  This seems like the way to go, since
> (I presume) the process could then run its own clean shutdown when it
> is notified that the service must shutdown.

You are probably referring to one of my recent posts.  I still intend to
do this, but I cannot commit to as when.  However, we need this too so I
can only procrastinate so long...

If you are so inclined, my recommendation is to check out how inetd was
patched to be a service on NT:

I was going to use this as a starting point myself.


Jason Tishler
Director, Software Engineering       Phone: +1 (732) 264-8770 x235
Dot Hill Systems Corp.               Fax:   +1 (732) 264-8798
82 Bethany Road, Suite 7             Email: Jason(dot)Tishler(at)dothill(dot)com
Hazlet, NJ 07730 USA                 WWW:

In response to

pgsql-ports by date

Next:From: Jason TishlerDate: 2001-01-17 16:16:13
Subject: Re: Cygwin PostgreSQL CVS Patch
Previous:From: Stephan RichterDate: 2001-01-17 00:46:59
Subject: PostGreSQL on Windows Help

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group