Re: [HACKERS] postmaster.pid

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] postmaster.pid
Date: 1999-12-03 08:38:02
Message-ID: 199912030838.DAA08933@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> > > 2) if it fails to create pid file, call
> > > ExitPostmaster(1). ExitPostmaster calls proc_exit() and proc_exit
> > > calls exit().
> >
> > So you don't start if the pid file is there,
>
> Right.
>
> >or do you delete it if the
> > port is free?
>
> No. even if the port is free, there might be another postmaster that
> uses another one.
>
> Wait, maybe I can check postmaster.opts to see if another postamster
> really exists...

You can do kill(0) on the pid to see if it is actually a real pid.
Rather than playing with the port, just check the pid because the
postmaster could be startup up by not on the port yet.

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 1999-12-03 08:43:51 Re: [HACKERS] postmaster.pid
Previous Message Magnus Hagander 1999-12-03 08:34:17 RE: [HACKERS] perl-DBD-Pg (was Re: BOUNCE pgsql-ports@postgreSQL .org:Non-member submission from[Joe Brenner <doom@kzsu.stanford.edu>] (f wd))