Re: postgresql start/stop/status script

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: postgresql start/stop/status script
Дата
Msg-id 23784.1114005199@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: postgresql start/stop/status script  (Peter Eisentraut <peter_e@gmx.net>)
Список 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 по дате отправления:

Предыдущее
От: Terry Lee Tucker
Дата:
Сообщение: Re: UNSUBSCRIBE
Следующее
От: Alexandre
Дата:
Сообщение: Re: Simplified (a-la [G|N]DBM) DB access