Re: hard shutdown of system

From: "surabhi(dot)ahuja" <surabhi(dot)ahuja(at)iiitb(dot)ac(dot)in>
To: "chris smith" <dmagick(at)gmail(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: hard shutdown of system
Date: 2006-04-17 12:07:16
Message-ID: 8626C1B7EB748940BCDD7596134632BE398674@jal.iiitb.ac.in
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

hi,

yah i took this script only and built upon that

the problem is that the statement
"pidof postmaster"

will return some valu even if

ps -aef | grep postmaster does not return anything

if i do kill -9 <process id of postmaster?

and i do pidof postmaster,
some machines it will show nothing

and on some machines it still shows some value, althou ps -aef | grep postmaster does not display anything.

so in such machines i ll have to check for both, pidof as well as ps -aef | grep postmaster.

is this ok?

________________________________

From: chris smith [mailto:dmagick(at)gmail(dot)com]
Sent: Mon 4/17/2006 1:14 PM
To: surabhi.ahuja
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] hard shutdown of system

***********************
Your mail has been scanned by InterScan VirusWall.
***********-***********

On 4/17/06, surabhi.ahuja <surabhi(dot)ahuja(at)iiitb(dot)ac(dot)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/

Browse pgsql-general by date

  From Date Subject
Next Message surabhi.ahuja 2006-04-17 12:20:35 catch SQLException, error code for Foeign key violation,
Previous Message Andrew - Supernews 2006-04-17 11:18:36 Re: Replacing MD5 hash in pg_auth...