Re: hard shutdown of system - Mailing list pgsql-general

From chris smith
Subject Re: hard shutdown of system
Date
Msg-id 3c1395330604170044x1a191bf6m3fe81a4ae2507b7e@mail.gmail.com
Whole thread Raw
In response to hard shutdown of system  ("surabhi.ahuja" <surabhi.ahuja@iiitb.ac.in>)
List pgsql-general
On 4/17/06, surabhi.ahuja <surabhi.ahuja@iiitb.ac.in> wrote:
>
> the user tries to do kill -9 -1 and log in again
>
> in the startup script i do the following
>
> /sbin/pidof -s postmaster
>
> and it still displays some value,
>
> however ps -aef | grep postmaster does not display anything
>
> is it ok if i do the following
>  pid1=`/sbin/pidof -s postmaster`
>  pid2=`ps -eaf | grep postmaster | grep -v grep | tail -1 | awk '{print
> $2}'`
>
> if ($pid1 and $pid2)
> => postmaster is already running
>
> otherwise
>
> i check if postmaster.pid exists
> if it does, i delete it
> and then start postmaster by doing $PGCTL -l $POSTGRES_LOG -D $PGDATA -p
> $POSTMASTER -o '-p ${PGPORT}' start  > /dev/null 2>&1

Check out the startup script. Depending on what system you are
running, this might already all be taken care of.

Here's a mandrake example (I think the redhat version is pretty similar).

http://techdocs.postgresql.org/scripts/mandrake72-startup

--
Postgresql & php tutorials
http://www.designmagick.com/

pgsql-general by date:

Previous
From: "surabhi.ahuja"
Date:
Subject: hard shutdown of system
Next
From: "Dawid Kuroczko"
Date:
Subject: Re: Select first ten of each category?