pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Allan Engelhardt <allane@cybaea.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Automatically starting postmaster after system crash
Date: Wed, 17 Oct 2001 10:50:12 -0400
Message-ID: <26865.1003330212@sss.pgh.pa.us> (raw)
In-Reply-To: <3BCD4B1B.2080907@cybaea.com>
References: <3BCD4B1B.2080907@cybaea.com>

Allan Engelhardt <allane@cybaea.com> writes:
> If my (RH 7.1) system crashes PostgreSQL does not restart automatically 
> because the shared memory segment identifier and the .pid file remains, 

That's kinda hard to believe; how would a shared memory segment survive
a system crash?

>   % pg_ctl start
>   pg_ctl: Another postmaster may be running.  Trying to start postmaster 
> anyway.
>   Found a pre-existing shared memory block (ID 693600256) still in use.

Darn, I thought we had fixed that class of problems.  Would you try
tracing through SharedMemoryIsInUse() to figure out why it thinks that?
It could be that there's some platform-specific variation of shmctl()
behavior that we need to cater for.

> What is the "proper" way of ensuring (as far as possible) that 
> PostgreSQL starts automatically after a crash?  Is it sufficient (and 
> safe) to include a 'rm -f $PGDATA/postmaster.pid' in the system boot 
> scripts?

You can do that if you want, but MHO is that this is a bug we need to
fix.

			regards, tom lane



view thread (4+ messages)  latest in thread

Message-ID: <26865.1003330212@sss.pgh.pa.us>
Permalink:  ../26865.1003330212@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/26865.1003330212@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, allane@cybaea.com
  Subject: Re: Automatically starting postmaster after system crash
  In-Reply-To: <26865.1003330212@sss.pgh.pa.us>
  References: <3BCD4B1B.2080907@cybaea.com> <26865.1003330212@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