From: Tom Lane <tgl@sss.pgh.pa.us>
To: Mischa Sandberg <mischa_sandberg@telus.net>
Cc: pgsql-admin@postgresql.org
Subject: Re: Reliably determining whether the server came up
Date: Tue, 18 Nov 2008 13:20:25 -0500
Message-ID: <22317.1227032425@sss.pgh.pa.us> (raw)
In-Reply-To: <1227026844.4922f19ce4c77@legacywebmail.telus.net>
References: <1226527535.491b532f4c45e@legacywebmail.telus.net>
<491F1861.4060403@reedyriver.com>
<1226780945.491f3111e22de@legacywebmail.telus.net>
<1226781115.22056.1.camel@jd-laptop.pragmaticzealot.org>
<49200BD8.4060703@reedyriver.com>
<1226989027.49225de368848@legacywebmail.telus.net>
<20048.1227023982@sss.pgh.pa.us>
<1227026844.4922f19ce4c77@legacywebmail.telus.net>
Mischa Sandberg <mischa_sandberg@telus.net> writes:
> Quoting Tom Lane <tgl@sss.pgh.pa.us>:
>> I'd bet that the pg_ctl status part is failing. I get exit status 1
>> from it if there's no server running.
> Yes, that was part of the problem with the original startup script;
> postmaster hadn't even gotten as far as writing postmaster.pid,
> I guess. But pg_ctl status returning 1 could also mean that that the
> server had come up, hit a critical problem and exited. Hence my problem;
> this has to detect server failure, reliably, as well.
You could sleep for a second or so *before* you start looking for the
pidfile.
> In another vein, another place where there are consistent
> failures is in the sequence:
> createlang ... -d template1 plpgsql
> createdb $PGDATABASE
> <app>
This should be fixed in 8.3 and up. In older releases about all you
can do is delay a second or so to let the old backend exit.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, mischa_sandberg@telus.net
Subject: Re: Reliably determining whether the server came up
In-Reply-To: <22317.1227032425@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox