Re: postmaster.pid file auto-clean up?

From: Sebastien Boisvert <sebastienboisvert(at)yahoo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: postmaster.pid file auto-clean up?
Date: 2012-08-21 03:03:20
Message-ID: F85A1CA4-8409-410A-B363-D1392E9127FC@yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Is this mechanism documented anywhere (besides source code)?

It looks like PG will only clean it up if there's no other process running at all on the pid listed in the postmaster.pid file, even if any process running on that pid isn't a PG process or there's no server running on the data directory (as per `pg_ctl status`).

On Aug 20 2012, at 1:31 PM, Tom Lane wrote:

> Sebastien Boisvert <sebastienboisvert(at)yahoo(dot)com> writes:
>> I vaguely remember reading in the release notes (around the time 9.x was released) something about it automatically clearing out the postmaster.pid file if it was found to be stale/invalid when starting the the database server, however I cannot find any reference to this anymore.
>
> It's always done that.
>
> We occasionally see startup scripts that "helpfully" remove the .pid
> file. They are, without exception, wrong and dangerous. The postmaster
> is much more likely to get this right by itself.
>
> regards, tom lane
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2012-08-21 03:30:56 Re: postmaster.pid file auto-clean up?
Previous Message Craig Ringer 2012-08-21 01:39:20 Re: How hard would a "path" operator be to implement in PostgreSQL