Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux