Re: [GENERAL] Again: How the hell do I restart immediately - Mailing list pgsql-general

From Mike Mascari
Subject Re: [GENERAL] Again: How the hell do I restart immediately
Date
Msg-id 19991008194645.17388.rocketmail@web2103.mail.yahoo.com
Whole thread Raw
Responses Re: [GENERAL] Again: How the hell do I restart immediately
List pgsql-general
--- Michael Simms <grim@argh.demon.co.uk> wrote:
> >
> > I posted this question before and got no good
> responses. I'm posting it
> > again out of pure desperation.
> >
> > I've got a Postgres 6.5.1 server running on a
> RedHat (i386) 5.2 box.
> > PostgreSQL was compiled from source with no
> special configuration options.
> >
> > The server is dying about once or twice a week.
> This is making me look like
> > crap to the rest of the company since our
> e-commerce solution is built up
> > around PostgreSQL and we can't take orders when
> the sevrer is down.
> >
> > What can I do to ensure (a) the server doesn't go
> down or (b) if the server
> > does down, it gets restarted immediately?!
> >
> > Please respond if you have any good ideas.
>
> Well, I have a hack of a little shell script that
> will restart it
> within 60 seconds. Its not efficient, pleasant or
> anything else, but
> it does the job

...[snip]...

According to the INSTALL document which came with
the distribution (possibly the following remark has
been removed in recent versions?), for RedHat Linux:

----------------------------------------------------
In RedHat Linux edit file /etc/inittab to add the
following as a single line:

pg:2345:respawn:/bin/su - postgres -c
  "/usr/local/pgsql/bin/postmaster
   -D/usr/local/pgsql/data >>
   /usr/local/pgsql/server.log 2>&1 </dev/null"
----------------------------------------------------

When the postmaster dies, init will automatically
respawn it, much the same as getty, or xdm, etc.
Now, since init will be starting the postmaster,
the /etc/rc.d/init.d script should be removed and
the links to it in /etc/rc.d/rc[whatever].d should
also be removed (or you could just not run this
service using linuxconf using the control service
activity option). And, of course, the switches in
the inittab entry above should be adjusted accordingly
to the appropriate site's settings.

That should ease the symptom but the problem still
remains. We run an e-commerce type web-based
application backed by PostgreSQL 6.5 around the clock.
I haven't seen a postmaster die since 6.4.0. Is there
any indication as to what is causing the postmaster to
die?

Hope the above helps,
Mike Mascari
(mascarim@yahoo.com)








=====

__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com

pgsql-general by date:

Previous
From: "Doran L. Barton"
Date:
Subject: Re: [GENERAL] Again: How the hell do I restart immediately
Next
From: "Doran L. Barton"
Date:
Subject: Re: [GENERAL] Again: How the hell do I restart immediately