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 14:48:42 -0500
Message-ID: <20030508194842.GA4152@wolff.to> (raw)
In-Reply-To: <200305081439.08973.mlaks@bellatlantic.net>
References: <200305081250.49994.mlaks@bellatlantic.net>
	<200305081410.52791.mlaks@bellatlantic.net>
	<20030508184033.GA3731@wolff.to>
	<200305081439.08973.mlaks@bellatlantic.net>

On Thu, May 08, 2003 at 14:39:08 -0400,
  mlaks <mlaks@bellatlantic.net> wrote:
> 
> now we would not want to kill the postmaster, of course. But should we even be 
> TERM'ing the postmaster? I dont know. What do the Postgresql Gurus say? 

I regularly use svc -d to shutdown postmaster and svc -u to restart it.
This works just fine.

> Moreover, if we agree that we need to imbed pg_ctl or postmaster in a script 
> to handle the above things, it should be doable to handle all of the assorted 
> other files if they are neccesary to handle .

You don't have to do that.
 
> Also what would be the problem in checking for the existence of a postmaster 
> and if none exists then killing the lock files. 

I would be very leary of putting this in a script. postmaster already does
this and trying to be smarter than it might cause you a lot of grief.

> My main problem is that I have machines that get creamed by power surges, and 
> then wont restart postgresql on reboot of the system because of the damn lock 
> files. I really want to deal with them up front! 

Most of the time when I have unscheduled shutdowns postgres comes up without
problem. I don't remember if I have had any since I switched to using
supervise though. I have had more issues with someone needing to answer
a question from fsck from the console than postgresql not coming up.

> MOreover can you tell me more about what init uses the locks for?

To tell if the service is already running or not.

> 
> what is the role of the files
> 
> /var/run/postmaster.pid
> /var/lock/subsys/postgresql
> 
> that Lamar carefully adds and subtracts?

I don't know exactly, but I would expect that the pid file is a lock for
the service and that the subsys file is a lock to keep two init scripts
from running for the same time for the same service.




view thread (9+ messages)  latest in thread

Message-ID: <20030508194842.GA4152@wolff.to>
Permalink:  ../20030508194842.GA4152@wolff.to/
Also on:    postgresql.org/message-id/20030508194842.GA4152@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: <20030508194842.GA4152@wolff.to>
  References: <200305081250.49994.mlaks@bellatlantic.net> <200305081410.52791.mlaks@bellatlantic.net> <20030508184033.GA3731@wolff.to> <200305081439.08973.mlaks@bellatlantic.net> <20030508194842.GA4152@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