Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YQeTM-0006g0-E9 for pgsql-bugs@arkaria.postgresql.org; Wed, 25 Feb 2015 16:06:04 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YQeTL-0008UI-Tp for pgsql-bugs@arkaria.postgresql.org; Wed, 25 Feb 2015 16:06:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YQOLk-0007f1-OV for pgsql-bugs@postgresql.org; Tue, 24 Feb 2015 22:53:08 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YQOLg-00079E-6M for pgsql-bugs@postgresql.org; Tue, 24 Feb 2015 22:53:07 +0000 MIME-Version: 1.0 Subject: BUG #12801: data_directory postgresql.conf setting is not honored on Centos 6.6 To: pgsql-bugs@postgresql.org From: kyle.sletmoe@elementaltechnologies.com Date: Tue, 24 Feb 2015 22:52:35 +0000 Message-ID: <20150224225235.2529.87182@wrigleys.postgresql.org> X-Pg-Spam-Score: -1.9 (-) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org The following bug has been logged on the website: Bug reference: 12801 Logged by: Kyle Sletmoe Email address: kyle.sletmoe@elementaltechnologies.com PostgreSQL version: 9.3.6 Operating system: Centos 6.6 Description: According to http://www.postgresql.org/docs/9.3/static/runtime-config-file-locations.html, I should be able to put my configuration files (postgresql.conf, pg_hba.conf, pg_ident.conf) in a different directory than my data directory, as long as I set the PGDATA environment variable to the directory that contains postgresql.conf and then set the data_directory variable in postgresql.conf to point to the directory that actually contains the postgres data. To configure this, I did a fresh install of PostgreSQL 9.3.6 on a Centos 6.5 (x64) machine, following the instructions here: https://wiki.postgresql.org/wiki/YUM_Installation. I created a directory for the data ('/data/pgsql/data') and one for configuration ('/data/pgsql/config'). I then ran `su postgres -c '/usr/pgsql-9.3/bin/initdb -D /data/pgsql/data'`, and then moved the .conf files out of /data/pgsql/data into /data/pgsql/config. I then modified postgresql.conf, setting "data_directory = '/data/pgsql/data'", "pg_file = '/data/pgsql/config/pg_hba.conf'", and "ident_file = '/data/pgsql/config/pg_ident.conf'". Lastly, I updated /etc/sysconfig/pgsql/postgresql-9.3 to include "export PGDATA=/data/pgsql/config". When I ran `sudo service postgresql-9.3 start`, I got this error message: '/data/pgsql/config is missing. Use "service postgresql-9.3 initdb" to initialize the cluster first.'. I looked at the postgres init script ('/etc/init.d/postgresql-9.3') and noticed this message will be emitted if this bash statement results in false: "if [ -f "$PGDATA/PG_VERSION" ] && [ -d "$PGDATA/base" ]". $PGDATA in this context is config directory like we set above in the /etc/sysconfig/pgsql/postgresql-9.3 file. The init script needs to check the value of data_directory in postgresql.conf in order to see if the data in the data directory is valid. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs