pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Evan Rempel <erempel@uvic.ca>
To: pgsql-admin@lists.postgresql.org
Subject: Moving the data directory for systemd service startup
Date: Mon, 23 Jul 2018 10:19:31 -0700
Message-ID: <56130215-3c42-69cd-2d01-6f8aea6da46a@uvic.ca> (raw)

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.





view thread (6+ messages)  latest in thread

Message-ID: <56130215-3c42-69cd-2d01-6f8aea6da46a@uvic.ca>
Permalink:  ../56130215-3c42-69cd-2d01-6f8aea6da46a@uvic.ca/
Also on:    postgresql.org/message-id/56130215-3c42-69cd-2d01-6f8aea6da46a@uvic.ca

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: erempel@uvic.ca, pgsql-admin@lists.postgresql.org
  Subject: Re: Moving the data directory for systemd service startup
  In-Reply-To: <56130215-3c42-69cd-2d01-6f8aea6da46a@uvic.ca>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox