Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id AB7464763AB for ; Mon, 16 Sep 2002 16:41:28 -0400 (EDT) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by postgresql.org (Postfix) with ESMTP id 18C94476385 for ; Mon, 16 Sep 2002 16:41:28 -0400 (EDT) Received: from andrew by mail.libertyrms.com with local (Exim 3.22 #3 (Debian)) id 17r2gT-0007n9-00 for ; Mon, 16 Sep 2002 16:41:29 -0400 Date: Mon, 16 Sep 2002 16:41:29 -0400 From: Andrew Sullivan To: pgsql-admin@postgresql.org Subject: Re: auto removing stale pid for postmaster NT service Message-ID: <20020916164129.W4394@mail.libertyrms.com> Mail-Followup-To: Andrew Sullivan , pgsql-admin@postgresql.org References: <26090.1032182629@sss.pgh.pa.us> <20020916165546.9B98.TELLINI@areabusiness.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20020916165546.9B98.TELLINI@areabusiness.it>; from tellini@areabusiness.it on Mon, Sep 16, 2002 at 04:56:26PM +0200 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/187 X-Sequence-Number: 5726 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 implemented. A -- ---- Andrew Sullivan 204-4141 Yonge Street Liberty RMS Toronto, Ontario Canada M2P 2A8 +1 416 646 3304 x110