Re: automatic restart on reboot

Поиск
Список
Период
Сортировка
От scott.marlowe
Тема Re: automatic restart on reboot
Дата
Msg-id Pine.LNX.4.33.0301130936200.14202-100000@css120.ihs.com
обсуждение исходный текст
Ответ на automatic restart on reboot  ("Aurangzeb M. Agha" <aagha@bigfoot.com>)
Список 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 по дате отправления:

Предыдущее
От: Larry Rosenman
Дата:
Сообщение: DNS for POSTGRESQL.ORG
Следующее
От: "Pirtea Calin Iancu"
Дата:
Сообщение: Re: PostgreSQL on Windows