Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1av5mk-0002A6-No for pgsql-bugs@arkaria.postgresql.org; Tue, 26 Apr 2016 16:24:26 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1av5mj-00033H-NO for pgsql-bugs@arkaria.postgresql.org; Tue, 26 Apr 2016 16:24:25 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1av5m6-0002Js-Kw for pgsql-bugs@postgresql.org; Tue, 26 Apr 2016 16:23:46 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1av5m3-0008TN-TZ for pgsql-bugs@postgresql.org; Tue, 26 Apr 2016 16:23:45 +0000 Received: from bruce by momjian.us with local (Exim 4.84_2) (envelope-from ) id 1av5m2-0000fC-1h; Tue, 26 Apr 2016 12:23:42 -0400 Date: Tue, 26 Apr 2016 12:23:42 -0400 From: Bruce Momjian To: tigreavecdesailes@gmail.com Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #14014: postgresql95-setup script determines PGDATA wrongly Message-ID: <20160426162342.GA3706@momjian.us> References: <20160310122249.8904.72105@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160310122249.8904.72105@wrigleys.postgresql.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -2.9 (--) 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 Uh, we don't have a postgresql95-setup file. I think you need to file this bug report with Red Hat or the author of this file. --------------------------------------------------------------------------- On Thu, Mar 10, 2016 at 12:22:49PM +0000, tigreavecdesailes@gmail.com wrote: > The following bug has been logged on the website: > > Bug reference: 14014 > Logged by: leonty > Email address: tigreavecdesailes@gmail.com > PostgreSQL version: 9.5.1 > Operating system: RHEL 7.2 > Description: > > The script postgresql95-setup tries to determine the PGDATA directory two > times: > > 1. first time using a systemctl call. That's ok, systemctl knows all > possible unit file places and processes correctly the drop-ins (a directory > in /etc/systemd/system/ ending with '.d' where partial configurations are > stored). > > 2. second time (why at all??) in a few lines using sed utility to parse the > unit file. That's wrong because drop-in directories won't be considered and > overridden PGDATA environment is missed. > > How to reproduce: > create /etc/systemd/system/postgresql-9.5.service.d/pgdata.conf with the > following content: > [Service] > Environment=PGDATA=/tmp/another_postgresql_location > > run 'postgresql95-setup initdb', get a successful result message, then run > 'systemctl start postgresql-9.5'. The database won't start, the log contains > a message that the database is not initialized. > > How to fix: > Probably it's just enough to delete the second try of parsing the unit file > from postgresql95-setup script. Lines 103-104: > # Get data directory from the service file > PGDATA=`sed -n 's/Environment=PGDATA=//p' "${SERVICE_FILE}"` > > > > -- > Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-bugs -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription + -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs