Re: postgresql start/stop/status script

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Baldur Norddahl <bbn-pgsql(dot)general(at)clansoft(dot)dk>, pgsql-general(at)postgresql(dot)org
Subject: Re: postgresql start/stop/status script
Date: 2005-04-20 13:53:19
Message-ID: 23784.1114005199@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> Baldur Norddahl wrote:
>> Is there a better way to query the status of postgresql? I would
>> expect it to at least check that the process in the PID is actually
>> running and that it is a postgresql process.

> Maybe try
> test $(readlink /proc/$pid/exe) = /usr/bin/postgres

I think the question stands though: why doesn't pg_ctl check that the
PID in the lockfile corresponds to a live process? A quick kill(pid,0)
would raise the robustness of the status check quite a lot, and now that
the code is in C it's a trivial addition.

Unless someone sees a reason not to do this, I will throw the change
into current and 8.0 branches.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alexandre 2005-04-20 13:57:49 Re: Simplified (a-la [G|N]DBM) DB access
Previous Message Chris Browne 2005-04-20 13:39:18 Re: Simplified (a-la [G|N]DBM) DB access