Re: PSA: Systemd will kill PostgreSQL

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: "Joshua D(dot) Drake" <linuxhiker(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PSA: Systemd will kill PostgreSQL
Date: 2016-07-11 05:25:51
Message-ID: CAMsr+YHhKA9+rzo=c0shEP_XatB=6uSEqMyjLbAeZAK=CjGqTA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11 July 2016 at 01:56, Joshua D. Drake <linuxhiker(at)gmail(dot)com> wrote:

> Hackers,
>
> This just came across my twitter feed:
>
> https://lists.freedesktop.org/archives/systemd-devel/2014-April/018373.html
>
> tl;dr; Systemd 212 defaults to remove all IPC (including SYSV memory) when
> a user "fully" logs out.
>
>
The underlying change sounds like a fix, not a problem. It ensures that
when a user logs out, various dangling processes are cleaned up. Given the
amount of work PostgreSQL has to do to try to make sure it's really gone,
having systemd be able to just clobber everything is pretty nice. So long
as there's control over it.

However, it will break existing deployments that use "non-system" users to
run PostgreSQL. I had a look and didn't find any useful definition of what
systemd considers a "system user". Perhaps by uid threshold in login.defs?
But then what happens for people who're managing users via a directory, who
need to avoid conflicting with host-local UIDs, but also need some of those
users to have systemd "system user" like behaviour?

It's also not clear if there's any API apps can use to exempt themselves
from this, or any wrapper command to spawn processes that aren't clobbered.
With appropriate user privileges to permit it, at least.

I've asked for clarification on the bug, so I'd better don my fire-proof
suit.

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2016-07-11 05:27:52 Re: Disable WAL completely - Performance and Persistency research
Previous Message Michael Paquier 2016-07-11 05:13:11 Re: [COMMITTERS] Logical decoding