Re: postgresql start/stop/status script - Mailing list pgsql-general

From Tom Lane
Subject Re: postgresql start/stop/status script
Date
Msg-id 23784.1114005199@sss.pgh.pa.us
Whole thread Raw
In response to Re: postgresql start/stop/status script  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-general
Peter Eisentraut <peter_e@gmx.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

pgsql-general by date:

Previous
From: Terry Lee Tucker
Date:
Subject: Re: UNSUBSCRIBE
Next
From: Alexandre
Date:
Subject: Re: Simplified (a-la [G|N]DBM) DB access