Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fheVh-00059X-Hv for pgsql-admin@arkaria.postgresql.org; Mon, 23 Jul 2018 17:20:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fheVf-0007L6-Lz for pgsql-admin@arkaria.postgresql.org; Mon, 23 Jul 2018 17:20:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fheVf-0007Kz-Dz for pgsql-admin@lists.postgresql.org; Mon, 23 Jul 2018 17:20:35 +0000 Received: from cuttlefish.comp.uvic.ca ([142.104.42.99]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fheVY-0006wI-QH for pgsql-admin@lists.postgresql.org; Mon, 23 Jul 2018 17:20:32 +0000 Received: from strike.comp.uvic.ca (strike.comp.uvic.ca [142.104.191.240]) by cuttlefish.comp.uvic.ca (8.14.4/8.14.3) with ESMTP id w6NHKMrE025789 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Mon, 23 Jul 2018 10:20:22 -0700 To: pgsql-admin@lists.postgresql.org From: Evan Rempel Subject: Moving the data directory for systemd service startup Message-ID: <56130215-3c42-69cd-2d01-6f8aea6da46a@uvic.ca> Date: Mon, 23 Jul 2018 10:19:31 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-MW X-UVic-Virus-Scanned: OK - Passed virus scan by ClamAV (clamd) on cuttlefish X-UVic-Virus-Scanned: OK - Passed virus scan by Sophos (sophie) on cuttlefish X-UVic-Scan: cuttlefish.comp.uvic.ca filter_version 3.7.9 X-Scanned-By: MIMEDefang 2.78 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I am using the official RPMs for RHEL-7 and am having difficulty in using a different database directory than the default of /var/lib/pgsql/9.6/data/ or /var/lib/pgsql/10/data/ It is easy to modify the service file /usr/lib/systemd/system/postgresql-9.6.service with the line Environment=PGDATA=/var/lib/pgsql/9.6/data/ to point to the location I want, but an RPM update will replace this file and break database startup. I was hoping that there would be a line EnvironmentFile=-/etc/sysconfig/pgsql/postgresql-9.6 or EnvironmentFile=-/etc/sysconfig/pgsql/postgresql-10 to allow for customization of the environment variables, similar to the init.d startup, but I don't see one. Am I missing something, or is the configuration of the systemd unit file an oversight? Any information would be helpful. Evan.