Loading Postgres server at bootup on Linux and shutting down.
Loading Postgres server at bootup on Linux and shutting down.
От:
Matthew Stanfield <matthew@propertyknowledge.com>
Дата:
Hi, The Postgresql admin manual (admin-7.2-A4.pdf) informs me that to start the postgresql server on Linux (Redhat 7.2, Kernel 2.4.7-10) at bootup I should add the following line: File: /etc/rc.d/rc.local Line: /path/pgsql/bin/pg_ctl start -l logfile -D /path/pgsql/data But I thought I was supposed to start the postgesql server as user 'postgres'. Here is how I manually start the postgresql server: su -c 'pg_ctl start -l /var/lib/pgsql/logs/serverlog -D /var/lib/pgsql/data -o -i' postgres How do I adapt this line for inclusion into the /etc/rc.d/rc.local file? When this is working how do I tell Linux to run the server shutdown command (below) so it stops correctly on shutdown/reboot? su -c 'pg_ctl stop -D /var/lib/pgsql/data -m s' postgres Or will the postgresql server shutdown safely automatically when I shutdown/reboot Linux? Many thanks for your help, regards, ..matthew