Re: Moving the data directory for systemd service startup - Mailing list pgsql-admin

From Johannes Truschnigg
Subject Re: Moving the data directory for systemd service startup
Date
Msg-id 20180723174049.c6zs3kg5cra52npt@vault.lan
Whole thread Raw
In response to Re: Moving the data directory for systemd service startup  (Evan Rempel <erempel@uvic.ca>)
List pgsql-admin
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.

Attachment

pgsql-admin by date:

Previous
From: Evan Rempel
Date:
Subject: Re: Moving the data directory for systemd service startup
Next
From: Michael Ireland
Date:
Subject: RE: Moving the data directory for systemd service startup