pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: mlaks <mlaks@bellatlantic.net>
To: pgsql-admin@postgresql.org
Subject: Postgresql goes down need to restart (redhat postgresql service script) lock files removal avoid 2 postmasters
Date: Thu, 8 May 2003 12:50:49 -0400
Message-ID: <200305081250.49994.mlaks@bellatlantic.net> (raw)

Hi, 
Thank you Tom.
I have been looking at the postgresql service startup scripts in Redhat 
written by Lamar Owen et al.

I would like to understand what is the role of the following files that are 
created during startup of Postgresql on my Redhat Linux box.

1.  /var/lib/pgsql/data/postmaster.pid

2.  /var/run/postmaster.pid (for redhat 7.3/Postgresql 7.2) 
    /var/run/postmaster5432.pid (for redhat 9.0/Postgresql 7.3.2)

3.  /var/lock/subsys/postgresql

and 

4.  /tmp/.s.PGSQL.5432.lock (and associated link to the directory in that 
directory).

I notice that the file 

1. /var/lib/pgsql/data/postmaster.pid contains the pid of the 
/usr/bin/postmaster process. Interestingly Lamar does not rm this file on 
stop().

2. /var/run/postmaster.pid contains the pid of a postgres stats process

3. the  /tmp/.s.PGSQL.5432.lock file has the pid of the /usr/bin/postmaster 
process.

Why do I care?

My goal is to use   DJ Bernsteins daemonstools to make sure that my Postgresql 
process goes back up unattended if it goes down for some reason. So I will be 
substituting daemontools for the postgresql service script.
Thus I want to know what lock files to remove to make sure all is ok. I also 
want to follow Tom Lanes's advice and not shoot myself in the foot by 
creating two different postmaster processes working the same database!!!!

Thank you all for your help!!!

Mitchell Laks




view thread (9+ messages)  latest in thread

Message-ID: <200305081250.49994.mlaks@bellatlantic.net>
Permalink:  ../200305081250.49994.mlaks@bellatlantic.net/
Also on:    postgresql.org/message-id/200305081250.49994.mlaks@bellatlantic.net

 · 

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: mlaks@bellatlantic.net
  Subject: Re: Postgresql goes down need to restart (redhat postgresql service script) lock files removal avoid 2 postmasters
  In-Reply-To: <200305081250.49994.mlaks@bellatlantic.net>
  References: <200305081250.49994.mlaks@bellatlantic.net>

* 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