[Pkg-postgresql-public] Bug#872915: Bug#759725: postgresql-common: non-synchronous service postgresql stop

Ludovic Gasc gmludo at gmail.com
Mon Aug 28 21:49:51 UTC 2017


Hi,

For whom interested, this is the systemd configuration file we are using
below this message, it's only for 9.6.

Certainly it would be possible to generalize that for any PostgreSQL
version.

BTW, now with the latest version of systemd, it might be possible to
replace directly pg_ctlcluster
 by a generic systemd configuration.
What do you think Christoph about this idea ? Are you interested in by a
general postgresql at .service solution without pg_ctlcluster usage ?
With my understanding of pg_ctlcluster, only "promote" action seems to be
missing with this idea.

[Unit]
Description=PostgreSQL database server
Documentation=man:postgres(1)

[Service]
Type=notify
User=postgres
ExecStart=/usr/lib/postgresql/9.6/bin/postgres -D
/var/lib/postgresql/9.6/main -c
config_file=/etc/postgresql/9.6/main/postgresql.conf
ExecReload=/bin/kill -s HUP $MAINPID
KillMode=mixed
KillSignal=SIGINT
TimeoutSec=0
# prevent OOM killer from choosing the postmaster (individual backends will
# reset the score to 0)
OOMScoreAdjust=-900

[Install]
WantedBy=multi-user.target


--
Ludovic Gasc (GMLudo)
Lead Developer Architect at ALLOcloud
https://be.linkedin.com/in/ludovicgasc

2017-08-22 22:08 GMT+02:00 Ludovic Gasc <gmludo at gmail.com>:

> 2017-08-22 16:23 GMT+02:00 Christoph Berg <myon at debian.org>:
>
>> I think you can simply use a drop-in config file:
>>
>> /etc/systemd/system/postgresql at .service.d/type.conf:
>> [Service]
>> Type=notify
>>
>
> With this configuration, the systemctl command never returns.
> To be sure I didn't made a mistake during my test, I have edited directly
> /lib/systemd/system/postgresql at .service
> systemctl stop postgresql
> systemctl daemon-reload
> systemctl start postgresql
>
> I have enabled full access to sd_notify with NotifyAccess=all in case of
> the signal comes from a subprocess, but it doesn't fix the behaviour.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-postgresql-public/attachments/20170828/9cbec76b/attachment.html>


More information about the Pkg-postgresql-public mailing list