Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 0E2B064FCD5 for ; Sun, 16 Nov 2008 08:02:42 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 89269-01 for ; Sun, 16 Nov 2008 08:02:38 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from fmailhost05.isp.att.net (fmailhost05.isp.att.net [207.115.11.55]) by mail.postgresql.org (Postfix) with ESMTP id CEC7B64FCAC for ; Sun, 16 Nov 2008 08:02:38 -0400 (AST) Received: from [127.0.0.1] (adsl-12-104-70.gsp.bellsouth.net[65.12.104.70]) by isp.att.net (frfwmhc05) with ESMTP id <20081116120235H0500cdek3e>; Sun, 16 Nov 2008 12:02:36 +0000 X-Originating-IP: [65.12.104.70] Message-ID: <49200BD8.4060703@reedyriver.com> Date: Sun, 16 Nov 2008 07:02:32 -0500 From: "H. Hall" User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: jd@commandprompt.com, Mischa Sandberg , pgsql-admin@postgresql.org Subject: Re: Reliably determining whether the server came up References: <1226527535.491b532f4c45e@legacywebmail.telus.net> <491F1861.4060403@reedyriver.com> <1226780945.491f3111e22de@legacywebmail.telus.net> <1226781115.22056.1.camel@jd-laptop.pragmaticzealot.org> In-Reply-To: <1226781115.22056.1.camel@jd-laptop.pragmaticzealot.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200811/81 X-Sequence-Number: 30735 Joshua D. Drake wrote: > On Sat, 2008-11-15 at 12:29 -0800, Mischa Sandberg wrote: > >> Quoting "H. Hall" : >> >> >>> Mischa Sandberg wrote: >>> >>>> I've been trying to work out a reliable script to determine, >>>> after pg_ctl start, that the server is done attempting >>>> to come up, and that it has either succeeded OR FAILED. >>>> This is for several hundred unattended appliance-type servers, >>>> currently on PG 8.0 but soon to be on 8.3 >>>> >>>> >>> Why don't you try to create a connection to a db on each server? >>> >> Thanks, but that only tells me if the server is up at the time of trying >> to connect. >> > > Actually it doesn't. If you are using any standard library to connect if > the server is not ready to accept connections, it will tell you when you > connect. If the server failed to come up, you won't get a connection at > all, if you try to connect and you are able to connect but not initiate > a session and appropriate response will be sent. > > Joshua D. Drake > > Exactly. :-) Also, once you take a look at your solution code a light bulb may go off. Hey! This code could also be used to test the health of my db servers during production! If I just execute it in a timer thread . . . Hmmm. --cheers, HH -- H. Hall ReedyRiver Group LLC www.reedyriver.com