Received: from sss.pgh.pa.us ([192.204.191.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f9HEoYP42803 for ; Wed, 17 Oct 2001 10:50:35 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id f9HEoDc26868; Wed, 17 Oct 2001 10:50:13 -0400 (EDT) To: Allan Engelhardt cc: pgsql-admin@postgresql.org Subject: Re: Automatically starting postmaster after system crash In-reply-to: <3BCD4B1B.2080907@cybaea.com> References: <3BCD4B1B.2080907@cybaea.com> Comments: In-reply-to Allan Engelhardt message dated "Wed, 17 Oct 2001 10:10:51 +0100" Date: Wed, 17 Oct 2001 10:50:12 -0400 Message-ID: <26865.1003330212@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200110/157 X-Sequence-Number: 2402 Allan Engelhardt 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