Re: file-locking and postmaster.pid - Mailing list pgsql-hackers

From Andreas Joseph Krogh
Subject Re: file-locking and postmaster.pid
Date
Msg-id 200605241143.32994.andreak@officenet.no
Whole thread Raw
In response to Re: file-locking and postmaster.pid  (Andreas Joseph Krogh <andreak@officenet.no>)
Responses Re: file-locking and postmaster.pid
List pgsql-hackers
On Wednesday 24 May 2006 11:36, Andreas Joseph Krogh wrote:
> On Tuesday 23 May 2006 19:36, Tom Lane wrote:
> > Adis Nezirovic <adis@linux.org.ba> writes:
> > > Well, maybe you could tweak postgres startup script, add check for post
> > > master (either 'pgrep postmaster' or 'ps -axu | grep [p]ostmaster'),
> > > and delete pid file on negative results.
> >
> > This is exactly what you should NOT do.
> >
> > A start script that thinks it is smarter than the postmaster is almost
> > certainly wrong.  It is certainly dangerous, too, because auto-deleting
> > that pidfile destroys the interlock against having two postmasters
> > running in the same data directory (which WILL corrupt your data,
> > quickly and irretrievably).  All it takes to cause a problem is to
> > use the start script to start a postmaster, forgetting that you already
> > have one running ...
>
> My PG is not started with startup-scripts, but with this command:
>
> pg_ctl -D $PGDATA -l $PGDIR/log/logfile-`date +%Y-%m-%d`.log start

... and manually after login, ie. not at boot-time.

--
Andreas Joseph Krogh <andreak@officenet.no>
Senior Software Developer / Manager
gpg public_key: http://dev.officenet.no/~andreak/public_key.asc
------------------------+---------------------------------------------+
OfficeNet AS            | The most difficult thing in the world is to |
Hoffsveien 17           | know how to do a thing and to watch         |
PO. Box 425 Skøyen      | somebody else doing it wrong, without       |
0213 Oslo               | comment.                                    |
NORWAY                  |                                             |
Phone : +47 22 13 01 00 |                                             |
Direct: +47 22 13 10 03 |                                             |
Mobile: +47 909  56 963 |                                             |
------------------------+---------------------------------------------+


pgsql-hackers by date:

Previous
From: Andreas Joseph Krogh
Date:
Subject: Re: file-locking and postmaster.pid
Next
From: Peter Eisentraut
Date:
Subject: Updatable views/with check option parsing