Re: Possible better pg_ctl start/stop handling?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Possible better pg_ctl start/stop handling?
Date: 2005-07-11 19:04:27
Message-ID: 11242.1121108667@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Joshua D. Drake" <jd(at)commandprompt(dot)com> writes:
> I was just wondering if we could make pg_ctl a little smarter as all.
> If pg_ctl can't start because the pid file exists, test for the
> existence of the pid, if the pid does not exist test for the existence
> of **any** postgres process (grep? egad...), if none exists overwrite
> the pid file and start?

This cannot be any smarter than the existing test in the postmaster,
and is most likely to be much stupider.

>> How did you get into this state anyway?

> Power off on a dev machine ;)

Does the dev machine run more than one postmaster? I've occasionally
seen similar issues when restarting a clutch of dev postmasters ---
the kernel may assign a shmem id to one of them that belonged to another
one in the previous cycle, and if you already started that other one
then the second gets confused. 8.0 and up have a test that should deal
correctly with this; what version did you see failing exactly?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua D. Drake 2005-07-11 19:06:08 Re: Possible better pg_ctl start/stop handling?
Previous Message Joshua D. Drake 2005-07-11 18:34:07 Re: Possible better pg_ctl start/stop handling?