Re: Can we add sample systemd service file to git repo?

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Nigel Heron <nheron(at)querymetrics(dot)com>
Cc: Devrim GÜNDÜZ <devrim(at)gunduz(dot)org>, PostgreSQL Hackers ML <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Can we add sample systemd service file to git repo?
Date: 2013-11-12 21:15:05
Message-ID: 52829A59.5000704@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 11/12/2013 03:54 PM, Nigel Heron wrote:
> On Tue, Nov 12, 2013 at 11:47 AM, Devrim GÜNDÜZ <devrim(at)gunduz(dot)org> wrote:
>> Hi,
>>
>> Many distros are switching/switched to systemd. In the git repo, we only
>> have init script for SysV. Would it make sense to add systemd service
>> script to our tarball as well? This could also standardize the systemd
>> scripts used in other distros.
>>
>> http://svn.pgrpms.org/browser/rpm/redhat/9.3/postgresql/F-19/postgresql-9.3.service is an example of what we use in the RPMs. (if website fails, please just reload)
>>
>> Attached is a modified version that will work with the compile defaults.
>
> Hi, should we put PGPORT in the systemd file without an easy way to override it?
> As an example, when yum updating minor versions on fedora 18 (using
> the yum.postgresql.org rpms), any changes to the systemd service file
> are overwritten by the new rpm and the port is forced back to 5432.
> This makes having pg9.2 and pg9.3 on the same box conflict after each
> minor version update.
> On RHEL6 with SysV we have /etc/sysconfig/[..] files to override the
> init.d script defaults. The same can be done with systemd using the
> "EnvironmentFile" directive, like this:
> [Service]
> EnvironmentFile=-/etc/sysconfig/postgresql
>
> which would let us keep our overrides of PGPORT and PGDATA across
> updates (the "=-" makes the file optional).
>
> Given a choice, I'd rather rely on postgresql.conf to set the port
> number though...

You might also find this useful, in particular Tom Lane's comment:
<http://people.planetpostgresql.org/andrew/index.php?/archives/233-Multi-tenancy-under-systemd.html>

cheers

andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2013-11-12 21:23:56 Re: Transaction-lifespan memory leak with plpgsql DO blocks
Previous Message Nigel Heron 2013-11-12 20:54:34 Re: Can we add sample systemd service file to git repo?