Re: Re: how to set up automatically startup database when the server boot or reboot.

Поиск
Список
Период
Сортировка
От Michael Nolan
Тема Re: Re: how to set up automatically startup database when the server boot or reboot.
Дата
Msg-id CAOzAquKHkK9ochM3bEo2FTKRCLYutGCOkAkE40Y_SKoOCzVh0w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: how to set up automatically startup database when the server boot or reboot.  (leaf_yxj <leaf_yxj@163.com>)
Список pgsql-general
Your options range from doing something simple to something complex.

A simple option on a Linux server would be placing a command like this in /etc/rc/rc.local:

su - postgres -C "/usr/local/pgsql/bin/pg_ctl -D ;/usr/local/pgsql/data -l /usr/local/pgsql/logfile start"

However, that might not be the optimal choice for every situation, because it doesn't take into account WHY the system rebooted.  A system that rebooted because of a power/UPS issue might need to be treated differently than one that rebooted because of a hardware failure or kernel panic.  (And just because postgres can restart the database, that doesn't always mean it should.  Even a well-written startup script might not know enough to make that decision for you.)

This might be good material for a tutorial on the wiki site, with some system-specific sections.
--
Mike Nolan


В списке pgsql-general по дате отправления:

Предыдущее
От: "hb@101-factory.eu"
Дата:
Сообщение: Re: Re: how to set up automatically startup database when the server boot or reboot.
Следующее
От: Filip Rembiałkowski
Дата:
Сообщение: Re: empty role names in pg_dumpall output