pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: mlaks <mlaks@bellatlantic.net>
Cc: pgsql-admin@postgresql.org
Subject: Re: Postgresql goes down need to restart (redhat postgresql service script) lock files removal avoid 2 postmasters
Date: Thu, 8 May 2003 19:49:47 -0500
Message-ID: <20030509004947.GA5745@wolff.to> (raw)
In-Reply-To: <200305081630.11078.mlaks@bellatlantic.net>
References: <200305081250.49994.mlaks@bellatlantic.net>
	<200305081439.08973.mlaks@bellatlantic.net>
	<20030508194842.GA4152@wolff.to>
	<200305081630.11078.mlaks@bellatlantic.net>

On Thu, May 08, 2003 at 16:30:11 -0400,
  mlaks <mlaks@bellatlantic.net> wrote:
> Bruno, Thanks for your help.
> 
> i checked - grep in the /etc/rc.d/init.d agrees with what you said - those 
> /var/lock and /var/run files are commonly placed in all of the services!
> 
> Here's my problem:
> 
> I had 4 out of 5 machines that got creamed this weekend, and all i needed to 
> go in for was to erase that file /var/lib/pgsql/data/postmaster.pid. 
> the same thing!!! (with only one machine) happened about a month ago. 
> 
> I notice that in his script Lamar does this
> 
> pid=`pidof -s postmaster`
>         if [ $pid ]
>         then
>                 echo $"Postmaster already running."
>         else
>                 #all systems go -- remove any stale lock files
>                 rm -f /tmp/.s.PGSQL.* > /dev/null
> then he starts up.
> 
> What I would be doing is simply adding in
>  
> rm  -f  /var/lib/pgsql/data/postmaster.pid  line. 
> 
> It looks like he isnt worried about getting rid of that tmp/.s.PGSQL.* file as 
> long as he ran pidof first - 
>  (is /tmp/.s.PGSQL.  also a kind of lock file? i dont know  -  do you know 
> what system sets it  up?)

Well if there is no process with the pid in postmaster.pid then you are safe.
If there is one then you have to know it isn't a postmaster.

> Also - what do you do about those files 
> 
> /tmp/.s.PGSQL.* ? 

These are place holders for the domain sockets used for local connections.

> 
> and what do you do about the possibility of supervise starting more than one 
> of the postmasters?

I do this. It is simpler to set up than making a bunch of different init
scripts. Just make sure each postmaster uses a different port and data
area.

> I like the idea of supervise starting me up again even without a reboot! and i 
> just want to catch this problem and solve it.
> 
> Thanks, mitchell




view thread (9+ messages)

Message-ID: <20030509004947.GA5745@wolff.to>
Permalink:  ../20030509004947.GA5745@wolff.to/
Also on:    postgresql.org/message-id/20030509004947.GA5745@wolff.to

 · 

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

* 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