Re: automatic restart on reboot - Mailing list pgsql-general

From scott.marlowe
Subject Re: automatic restart on reboot
Date
Msg-id Pine.LNX.4.33.0301130936200.14202-100000@css120.ihs.com
Whole thread Raw
In response to automatic restart on reboot  ("Aurangzeb M. Agha" <aagha@bigfoot.com>)
List pgsql-general
On Sun, 12 Jan 2003, Aurangzeb M. Agha wrote:

> I'm deploying Postgres on a production environment and wanted to know if
> people could share what steps they've taken to have their DB's come back
> up on system reboot (either on purpose or accidental).
>
> Are there any things to check for?
>
> What about postmaster.pid, /tmp/blah..., etc...  Any script examples would
> be appreciated.

I added the following lines to the /etc/rc.d/rc.local script:

rm -f /db/data/postmaster.pid
raidstart /dev/md0
mount /dev/md0 /mnt/db
su - postgres -c 'pg_ctl start | rotatelogs $PGDATA/pglog 86400 2>1&'

So, I make sure the old postmaster.pid is gone (since we're booting when
we run rc.local, it's safe to assume that any old postmaster.pid is left
over from a crash.)  Then I start the RAID array just in case it didn't
get started earlier, and mount it before running postgresql.  The outputs
of postgresql are then piped into apache's rotatelogs command to get me
daily rotated logs from postgresql.  Note that you need to have the path
to rotatelogs in postgres's path, or refer to it fully qualified to make
that work right.


pgsql-general by date:

Previous
From: Larry Rosenman
Date:
Subject: DNS for POSTGRESQL.ORG
Next
From: "Pirtea Calin Iancu"
Date:
Subject: Re: PostgreSQL on Windows