Re: Moving the data directory for systemd service startup

From: Johannes Truschnigg <johannes(at)truschnigg(dot)info>
To: Evan Rempel <erempel(at)uvic(dot)ca>
Cc: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Moving the data directory for systemd service startup
Date: 2018-07-23 17:40:49
Message-ID: 20180723174049.c6zs3kg5cra52npt@vault.lan
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)truschnigg(dot)info )

www: https://johannes.truschnigg.info/
phone: +43 650 2 133337
xmpp: johannes(at)truschnigg(dot)info

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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Michael Ireland 2018-07-23 18:02:15 RE: Moving the data directory for systemd service startup
Previous Message Evan Rempel 2018-07-23 17:36:46 Re: Moving the data directory for systemd service startup