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

Re: auto removing stale pid for postmaster NT service

From: Andrew Sullivan <andrew(at)libertyrms(dot)info>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: auto removing stale pid for postmaster NT service
Date: 2002-09-16 20:41:29
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-admin
On Mon, Sep 16, 2002 at 04:56:26PM +0200, Simone Tellini wrote:
> it happens on linux as well: if there's a stale file at boot, it refuses
> to start saying that it's already running.

Not exactly.

If there is a stale pid file, it looks to see if a process with that
pid exists.  _Then_ it refuses to start.

This is because there is a process with the same pid as the
postmaster.  This will happen in cases where the machine crashes and
starts up again -- something else happens to get the (former)
postgres pid at startup, and so when postgres checks for a process
with that pid, one exists.  And kerplooey.

I seem to recall that someone (maybe Tom Lane?) suggested an
extension to the current pidfile check, so that it will also check to
see if the process really is PostgreSQL.  But I don't know if it was


Andrew Sullivan                         204-4141 Yonge Street
Liberty RMS                           Toronto, Ontario Canada
<andrew(at)libertyrms(dot)info>                              M2P 2A8
                                         +1 416 646 3304 x110

In response to


pgsql-admin by date

Next:From: Andrew SullivanDate: 2002-09-16 20:48:27
Subject: Re: psql database recovery error
Previous:From: Elielson FontaneziDate: 2002-09-16 19:16:22
Subject: benchmark

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