[systemd-devel] Systemd 212 RemoveIPC=yes breaks postgresql

Lennart Poettering lennart at poettering.net
Tue May 20 17:37:45 PDT 2014


On Wed, 02.04.14 15:53, Alex Hunsaker (badalex at gmail.com) wrote:

> Systemd 212 defaults to remove all IPC (including SYSV memory) when a
> user "fully" logs out.
> 
> Because the postgresql service does not count as a login, if you ssh
> in as postgres (I'm rsycing wal files) and then logout. Systemd
> removes the postgres SYSV memory bringing down postgres with fun
> errors like:
> FATAL:  semop(id=92307463) failed: Invalid argument
> CONTEXT:  xlog redo insert: rel 1663/16414/112697213; tid 1319269/129
> LOG:  background writer process (PID 24589) exited with exit code 1
> LOG:  terminating any other active server processes
> LOG:  all server processes terminated; reinitializing
> LOG:  semctl(119406593, 0, IPC_RMID, ...) failed: Invalid argument
> 
> I was thinking the simple fix would be to add the below to postgresql.service:
> PAMname=systemd-login
> 
> But that does not work for two reasons:
> 1) it does not seem to register with logind (I dont get logs about
> Started User Manager for UID 88, like i do when I ssh in)
> 2) as soon as pg_ctl exits, the session gets closed. (pg_ctl starts
> postgres in the background)
> 
> Is there some other systemd.service knob I can turn? Or, for any
> machine running postgres is the recommendation to disable RemoveIPC ?

THis should be fixed now in systemd git. We will now check against the
system user UID threshold before removing the IPC objects.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list