Loading Postgres server at bootup on Linux and shutting down.

From: Matthew Stanfield <matthew(at)propertyknowledge(dot)com>
To: PostgreSQL General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Loading Postgres server at bootup on Linux and shutting down.
Date: 2002-05-03 12:48:54
Message-ID: 3CD28736.E6711CEF@propertyknowledge.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Browse pgsql-general by date

  From Date Subject
Next Message Jean-Michel POURE 2002-05-03 13:26:25 Re: making a trigger to a system call to a shell script
Previous Message Jean-Michel POURE 2002-05-03 12:19:59 Re: HOWTO - Random character generation for primary key