pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Johannes Truschnigg <johannes@truschnigg.info>
To: Evan Rempel <erempel@uvic.ca>
Cc: pgsql-admin@lists.postgresql.org
Subject: Re: Moving the data directory for systemd service startup
Date: Mon, 23 Jul 2018 19:40:49 +0200
Message-ID: <20180723174049.c6zs3kg5cra52npt@vault.lan> (raw)
In-Reply-To: <89787ab2-f7a6-9a15-ba29-1e7dc6b9befb@uvic.ca>
References: <56130215-3c42-69cd-2d01-6f8aea6da46a@uvic.ca>
	<20180723172652.slykd5awgpx7qx6i@vault.lan>
	<89787ab2-f7a6-9a15-ba29-1e7dc6b9befb@uvic.ca>

Hi Evan,

On Mon, Jul 23, 2018 at 10:29:52AM -0700, Evan Rempel wrote:
> Except that the systemd file comes from the postgresql10-server RPM produced by the PostgreSQL community.

The origin of your unit file doesn't matter to systemd on your EL7 host. You
can run

 # systemctl edit <yourunitfilename>

and (recent releases of) systemd will drop you into your $EDITOR in an
appropriately created drop-in unit extension file, or you can run

 # mkdir /etc/systemd/system/<yourunitfilename>.service.d/
 # $EDITOR /etc/systemd/system/<yourunitfilename>.service.d/environment.conf

and put your "Environment=PGDATA=/var/lib/pgsql/9.6/data/" stanza (take care
to get the INI-style section right!) into the resulting editor buffer.

Once you save that and `systemctl daemon-reload` your unit configuration, you
can use

 # systemctl cat <yourunitfilename>

to see what systemd makes of your changes, and then restart the service with
the changes applied.

The delta you introduced that way will survive package upgrades (but you'll
have to re-apply these changes to postgres service units with new/different
unit names, i. e. different major versions, in the same manner).

-- 
with best regards:
- Johannes Truschnigg ( johannes@truschnigg.info )

www:   https://johannes.truschnigg.info/
phone: +43 650 2 133337
xmpp:  johannes@truschnigg.info

Please do not bother me with HTML-email or attachments. Thank you.

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (6+ messages)  latest in thread

Message-ID: <20180723174049.c6zs3kg5cra52npt@vault.lan>
Permalink:  ../20180723174049.c6zs3kg5cra52npt@vault.lan/
Also on:    postgresql.org/message-id/20180723174049.c6zs3kg5cra52npt@vault.lan

 · 

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: johannes@truschnigg.info, erempel@uvic.ca, pgsql-admin@lists.postgresql.org
  Subject: Re: Moving the data directory for systemd service startup
  In-Reply-To: <20180723174049.c6zs3kg5cra52npt@vault.lan>

* 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