Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f9HJZNP41999 for ; Wed, 17 Oct 2001 15:35:23 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id f9HJSux12567 for pgsql-admin@postgresql.org; Wed, 17 Oct 2001 15:28:56 -0400 (EDT) (envelope-from news) From: Allan Engelhardt X-Newsgroups: comp.databases.postgresql.admin Subject: Re: Automatically starting postmaster after system crash Date: Wed, 17 Oct 2001 20:28:53 +0100 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 47 Message-ID: <3BCDDBF5.9050204@cybaea.com> References: <26865.1003330212@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: scrappy@hub.org To: Tom Lane User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.5) Gecko/20011011 X-Accept-Language: en-us To: pgsql-admin@postgresql.org X-Archive-Number: 200110/162 X-Sequence-Number: 2406 Tom Lane wrote: > 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? I don't think they can. Some options: (1) PostgreSQL keeps a reference to it somewhere and can get confused... (2) Red Hat's script for starting PostgreSQL at boot time, which (a) ran, (b) failed, and [Arrrgh! I *must* fix that stupid script ;-P] (c) directs all pg_ctl output (out+err) to /dev/null, somehow fubared the system. > 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. Uhm, my system doesn't crash *that* often... :-) Seriously: I tried to reproduce using SysRq+S, SysRq+B and couldn't. I think I have seen enough fsck for one night, so I might give it a rest... >>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. I'll see what I can do about reproducing it... Allan