X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id B605A9F946D for ; Mon, 22 May 2006 11:01:00 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 99925-02 for ; Mon, 22 May 2006 11:00:44 -0300 (ADT) X-Greylist: delayed 00:30:05.678099 by SQLgrey- Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 0BA8F9FA42B for ; Mon, 22 May 2006 11:00:44 -0300 (ADT) Received: from pat.uio.no (pat.uio.no [129.240.10.4]) by svr4.postgresql.org (Postfix) with ESMTP id 9AD1C5B5615 for ; Mon, 22 May 2006 13:30:32 +0000 (GMT) Received: from mail-mx1.uio.no ([129.240.10.29]) by pat.uio.no with esmtp (Exim 4.43) id 1FiAUO-0007CG-EC; Mon, 22 May 2006 15:30:28 +0200 Received: from linus.uio.no ([129.240.201.19]) by mail-mx1.uio.no with esmtps (TLSv1:AES256-SHA:256) (Exim 4.43) id 1FiAUL-0006bF-Ji; Mon, 22 May 2006 15:30:25 +0200 Message-ID: <4471BCF0.6050203@usit.uio.no> Date: Mon, 22 May 2006 15:30:24 +0200 From: Ola Sandbu Organization: USIT/SAPP-DBA User-Agent: Thunderbird 1.5.0.2 (X11/20060420) MIME-Version: 1.0 To: Nicola Mauri , pgsql-admin@postgresql.org Subject: Re: Init script for multiple postmasters References: <20060522123345.GB8586@surnet.cl> In-Reply-To: <20060522123345.GB8586@surnet.cl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-UiO-Spam-info: not spam, SpamAssassin (score=-4.985, required 12, autolearn=disabled, AWL 0.01, UIO_MAIL_IS_INTERNAL -5.00) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/288 X-Sequence-Number: 21820 On 05/22/2006 02:33 PM, Alvaro Herrera wrote: > Nicola Mauri wrote: > >> In this scenario the cluster manager cannot determine wether a single >> instance is running or down. >> I'm going to modify initscripts and use a differente approach to probe >> postmasters status, but I'm not sure if this is good: >> >> ps ax | grep postmaster | grep /var/lib/pgsql2/data2 >> ps ax | grep postmaster | grep /var/lib/pgsql/data >> >> What would you suggest? > > pg_ctl -d /var/lib/pgsql2/data2 status > My experience is that you can not know if the database is running or has died by only checking the status flag. But if you combines these two, by checking the PID process ID from the pg_ctl command and then use 'ps -ax' to see that this process is really alive, then you have a proof. rgds Ola Sandbu