public inbox for [email protected]  
help / color / mirror / Atom feed
From: Jeff Frost <[email protected]>
To: Bernd Helmle <[email protected]>
Cc: [email protected]
Subject: Re: systemd service files vs. postgresql9x-setup
Date: Wed, 12 Aug 2015 16:54:41 -0700
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
List-Unsubscribe: <mailto:[email protected]?body=unsub%20pgsql-pkg-yum>

> 
> On Aug 12, 2015, at 7:18 AM, Bernd Helmle <[email protected]> wrote:
> 
> Hi,
> 
> Looks like postgresql9[45]-setup is careless when someone tries to use them
> in customized
> systemd environments (e.g. via drop-in configurations[1]). Currently we do
> this:
> 
> # this parsing technique fails for PGDATA pathnames containing spaces,
> # but there's not much I can do about it given systemctl's output format...
> PGDATA=`systemctl show -p Environment "${SERVICE_NAME}.service" |
>                sed 's/^Environment=//' | tr ' ' '\n' |
>                sed -n 's/^PGDATA=//p' | tail -n 1`
> 
> [...some more code later...]
> 
> # Get data directory from the service file
> PGDATA=`sed -n 's/Environment=PGDATA=//p' "${SERVICE_FILE}"`
> 
> So we obviously overwrite any PGDATA setting returned by 'systemctl show'
> earlier. If someone uses service files only, this doesn't heavily matter,
> since SERVICE_FILE is tested against multiple locations. However, drop-in
> configurations are ignored/overwritten with this method. I don't
> understand, why we do the sed approach anyways, since 'systemctl show'
> already covers all cases, afaics. So i suggest to get rid of handling the
> SERVICE_FILE directly and leave 'systemctl show' alone, patch attached.
> 
> Opinions?
> 
> [1] <http://www.freedesktop.org/software/systemd/man/systemd.unit.html;

Unfortunately, I’m not that familiar with systemd yet and Devrim is out for a few weeks, so we might not get to this very quickly.

-- 
Sent via pgsql-pkg-yum mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-pkg-yum



view thread (7+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: systemd service files vs. postgresql9x-setup
  In-Reply-To: <[email protected]>

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

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