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 [email protected] 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 <[email protected]>:

> 2017-08-22 16:23 GMT+02:00 Christoph Berg <[email protected]>:
>
>> I think you can simply use a drop-in config file:
>>
>> /etc/systemd/system/[email protected]/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/[email protected]
> 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.
>
_______________________________________________
Pkg-postgresql-public mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-postgresql-public

Reply via email to