Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 306E21E74D9B for ; Tue, 29 Nov 2011 17:28:30 -0400 (AST) Received: from cerberus.pinpointresearch.com ([66.7.238.130] helo=polaris.pinpointresearch.com) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RVVE1-0006Wc-FT for pgsql-admin@postgresql.org; Tue, 29 Nov 2011 21:28:30 +0000 Received: from betelgeuse.pinpointresearch.com (betelgeuse.pinpointresearch.com [192.168.1.179]) by polaris.pinpointresearch.com (Postfix) with ESMTP id B049AE00EC82; Tue, 29 Nov 2011 13:28:11 -0800 (PST) Message-ID: <4ED54E6B.9070008@pinpointresearch.com> Date: Tue, 29 Nov 2011 13:28:11 -0800 From: Steve Crawford User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110922 Lightning/1.0b2 Thunderbird/3.1.15 MIME-Version: 1.0 To: Colin E Busse CC: pgsql-admin@postgresql.org Subject: Re: Use a custom postgresql.conf? References: In-Reply-To: Content-Type: multipart/alternative; boundary="------------070007020606060701030109" X-Pg-Spam-Score: -3.1 (---) X-Archive-Number: 201111/147 X-Sequence-Number: 38741 This is a multi-part message in MIME format. --------------070007020606060701030109 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 11/29/2011 01:06 PM, Colin E Busse wrote: > Hello, > > I am trying to determine how to get postgres to use a custom > postgresql.conf file that will be located in a directory other than > the default postgresql.conf file. I would like it to be installed via > an rc script so that the database setup can be part of a > self-contained install. I do not want to use symbolic links, and I do > not want to edit the default postgresql.conf file. I am using > PostgreSQL version 8.4.4 on Red Hat Enterprise Linux 6. Currently, I > am able to start the database using the following command, which > specifies my custom postgresql.conf file: > > pg_ctl start -D /var/lib/pgsql/data -l /var/lib/pgsql/pgstartup.log -o > "-c config_file='//postgresql.conf'" > > Is there a way to set this up so that I can simply call: > > service postgresql start > > And have the database start using my config file? > Don't have RHEL6 handy so looking at a CentOS 5.3 box... I *think* you should be able to put the custom settings in /etc/sysconfig/pgsql/postgresql which is used by /etc/init.d/postgresql to override its defaults. Set $PGOPTS to the custom additions to the standard startup command. The wiki page may be of help: http://wiki.postgresql.org/wiki/PostgreSQL_on_RedHat_Linux Cheers, Steve --------------070007020606060701030109 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 11/29/2011 01:06 PM, Colin E Busse wrote:
Hello,

I am trying to determine how to get postgres to use a custom postgresql.conf file that will be located in a directory other than the default postgresql.conf file.  I would like it to be installed via an rc script so that the database setup can be part of a self-contained install.  I do not want to use symbolic links, and I do not want to edit the default postgresql.conf file.  I am using PostgreSQL version 8.4.4 on Red Hat Enterprise Linux 6.  Currently, I am able to start the database using the following command, which specifies my custom postgresql.conf file:

pg_ctl start -D /var/lib/pgsql/data -l /var/lib/pgsql/pgstartup.log -o "-c config_file='/<path-to-custom-config-file>/postgresql.conf'"

Is there a way to set this up so that I can simply call:

service postgresql start

And have the database start using my config file?

Don't have RHEL6 handy so looking at a CentOS 5.3 box...

I *think* you should be able to put the custom settings in /etc/sysconfig/pgsql/postgresql which is used by /etc/init.d/postgresql to override its defaults. Set $PGOPTS to the custom additions to the standard startup command.

The wiki page may be of help: http://wiki.postgresql.org/wiki/PostgreSQL_on_RedHat_Linux

Cheers,
Steve

--------------070007020606060701030109--