Re: postmaster.pid

From: Joerg Hessdoerfer <Joerg(dot)Hessdoerfer(at)sea-gmbh(dot)com>
To: pgsql-hackers-win32(at)postgresql(dot)org
Subject: Re: postmaster.pid
Date: 2004-08-25 16:24:45
Message-ID: 200408251824.45938.Joerg.Hessdoerfer@sea-gmbh.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers-win32

Hi,

On Wednesday 25 August 2004 16:21, Magnus Hagander wrote:
> > >> > But sure, we don't really care if it's a postmaster. Then
> > >> > OpenProcess() is probably the best way, yes.
> > >>
> > >> Au contraire!! One of the problems with the Unix
> >
> > implementation is
> >
> > >> that you *can't* tell for sure if the target process is a
> >
> > postmaster.
> >
> > >> See past discussions about how startup occasionally fails
> >
> > because we
> >
> > >> get fooled by the PID mentioned in postmaster.pid now belonging to
> > >> pg_ctl or some other Postgres-owned process.
> > >>
> > >> This is a place where the Windows version can actually be
> >
> > better than
> >
> > >> the Unix one. Please fix it and stop imagining that your
> >
> > charter is
> >
> > >> to duplicate a particular Unix syscall bug-for-bug.
> > >
> > > Ok, if you say so :-) I had the general impression we
> >
> > wanted that. But
> >
> > > then let's go with the
> > > send-signal-0-down-the-pipe-and-ignore-it-in-the-backend. :-)

Well, wouldn't it be better then to do an OS-dependant check for a running
postmaster, which could use kill() on IMHO broken systems where it's not easy
to determine the processname for a PID, and more elaborate checking on
others. On Windows, there's OpenProcess et al, on Linux, one could resort
to /proc. I didn't develop on too many others, but there should be
possibilities for those, too.

Greetings,
Jörg
--
Leading SW developer - S.E.A GmbH
Mail: joerg(dot)hessdoerfer(at)sea-gmbh(dot)com
WWW: http://www.sea-gmbh.com

In response to

Responses

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message Andrew Dunstan 2004-08-25 17:53:59 Re: postmaster.pid
Previous Message Andrew Dunstan 2004-08-25 14:25:45 Re: postmaster.pid