Re: [HACKERS] postmaster.pid - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] postmaster.pid
Date
Msg-id 199912030838.DAA08933@candle.pha.pa.us
Whole thread Raw
In response to Re: [HACKERS] postmaster.pid  (Tatsuo Ishii <t-ishii@sra.co.jp>)
Responses Re: [HACKERS] postmaster.pid
List 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@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: RE: [HACKERS] perl-DBD-Pg (was Re: BOUNCE pgsql-ports@postgreSQL .org:Non-member submission from[Joe Brenner ] (f wd))
Next
From: Tatsuo Ishii
Date:
Subject: Re: [HACKERS] postmaster.pid