Automatically starting postmaster after system crash - Mailing list pgsql-admin

From Allan Engelhardt
Subject Automatically starting postmaster after system crash
Date
Msg-id 3BCD4B1B.2080907@cybaea.com
Whole thread Raw
Responses Re: Automatically starting postmaster after system crash
List pgsql-admin
Sorry if this is a FAQ, but I couldn't find it.

If my (RH 7.1) system crashes PostgreSQL does not restart automatically
because the shared memory segment identifier and the .pid file remains,
as a manual start explains:

  % 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.
  If you're sure there are no old backends still running,
  remove the shared memory block with ipcrm(1), or just
  delete "/var/lib/pgsql/data/postmaster.pid".
  pg_ctl: cannot start postmaster
  Examine the log output.

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?

Allan.


pgsql-admin by date:

Previous
From: Allan Engelhardt
Date:
Subject: Re: pg_restore blues
Next
From: Giles Constant
Date:
Subject: Mirroring with WAL?