pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: mlaks <mlaks@bellatlantic.net>
Cc: pgsql-admin@postgresql.org
Subject: Re: need to delete postmaster.pid file. automate it?
Date: Tue, 06 May 2003 00:36:14 -0400
Message-ID: <22351.1052195774@sss.pgh.pa.us> (raw)
In-Reply-To: <200305052327.45943.mlaks@bellatlantic.net>
References: <200305052327.45943.mlaks@bellatlantic.net>

mlaks <mlaks@bellatlantic.net> writes:
> I would like to automate this process of deleting postmaster.pid if
> postgresql is not running and would like to ask my question .

It is safe (and probably a good idea) to delete postmaster.pid in a
shell script that runs *ONLY DURING BOOTUP*.  Do *not* put such a
command into a script that you might run as a means of manually
restarting the postmaster --- because if you do, you just lost your
interlock against starting two postmasters for the same database.
Which, trust me, is not an interlock you want to lose.

There are quite a few other standard daemons, for instance sendmail,
that have similar issues with leftover lockfiles after a system
crash.  If you dig around in your boot scripts you may find one
that's already designed to remove unwanted lockfiles at system boot.
That'd be the place to add "rm /var/lib/pgsql/data/postmaster.pid".
But do not put it into anything that could be triggered after initial
system startup, unless you enjoy the sensation of shooting yourself
in the foot.

			regards, tom lane




view thread (2+ messages)

Message-ID: <22351.1052195774@sss.pgh.pa.us>
Permalink:  ../22351.1052195774@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/22351.1052195774@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, mlaks@bellatlantic.net
  Subject: Re: need to delete postmaster.pid file. automate it?
  In-Reply-To: <22351.1052195774@sss.pgh.pa.us>
  References: <200305052327.45943.mlaks@bellatlantic.net> <22351.1052195774@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox