Re: postgresql start/stop/status script

From: Baldur Norddahl <bbn-pgsql(dot)general(at)clansoft(dot)dk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: postgresql start/stop/status script
Date: 2005-04-20 09:10:34
Message-ID: 42661C8A.6090906@clansoft.dk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Peter Eisentraut wrote:

>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 have now changed my script to use this instead:

if pgrep -U pg0 'postmaster' > /dev/null
then
echo running
else
echo stopped
fi

I would still hold that "pg_ctl status" is broken though.

Baldur

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2005-04-20 10:03:19 Re: reorder table data
Previous Message Alexandre 2005-04-20 06:16:13 Re: Simplified (a-la [G|N]DBM) DB access