<div dir="ltr">Hi,<div><br></div><div>For whom interested, this is the systemd configuration file we are using below this message, it's only for 9.6.</div><div><br></div><div>Certainly it would be possible to generalize that for any PostgreSQL version.</div><div><br></div><div>BTW, now with the latest version of systemd, it might be possible to replace directly <span style="color:rgb(0,0,0);font-weight:bold;font-family:monospace">pg_ctlcluster</span></div><div> by a generic systemd configuration.</div><div>What do you think Christoph about this idea ? Are you interested in by a general postgresql@.service solution without pg_ctlcluster usage ?<br></div><div>With my understanding of pg_ctlcluster, only "promote" action seems to be missing with this idea.</div><div><br></div><div><div>[Unit]</div><div>Description=PostgreSQL database server</div><div>Documentation=man:postgres(1)</div><div><br></div><div>[Service]</div><div>Type=notify</div><div>User=postgres</div><div>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</div><div>ExecReload=/bin/kill -s HUP $MAINPID</div><div>KillMode=mixed</div><div>KillSignal=SIGINT</div><div>TimeoutSec=0</div><div># prevent OOM killer from choosing the postmaster (individual backends will</div><div># reset the score to 0)</div><div>OOMScoreAdjust=-900</div><div><br></div><div>[Install]</div><div>WantedBy=multi-user.target</div></div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">--<br><div style="font-size:small"><div>Ludovic Gasc (GMLudo)</div><div>Lead Developer Architect at ALLOcloud</div><div><a href="https://be.linkedin.com/in/ludovicgasc" target="_blank">https://be.linkedin.com/in/ludovicgasc</a></div></div></div></div></div></div></div>
<br><div class="gmail_quote">2017-08-22 22:08 GMT+02:00 Ludovic Gasc <span dir="ltr"><<a href="mailto:gmludo@gmail.com" target="_blank">gmludo@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">2017-08-22 16:23 GMT+02:00 Christoph Berg <span dir="ltr"><<a href="mailto:myon@debian.org" target="_blank">myon@debian.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I think you can simply use a drop-in config file:<br>
<br>
/etc/systemd/system/postgresql<wbr>@.service.d/type.conf:<br>
[Service]<br>
Type=notify<br></blockquote><div><br></div></span><div>With this configuration, the systemctl command never returns.</div><div>To be sure I didn't made a mistake during my test, I have edited directly /lib/systemd/system/<span style="white-space:pre-wrap">postgresql<wbr>@.service</span><br></div><div><span style="font-family:monospace"><span style="color:rgb(0,0,0)">systemctl stop postgresql</span><br></span></div><div><span style="font-family:monospace"><span style="color:rgb(0,0,0)">systemctl daemon-reload</span><br></span></div><div><span style="font-family:monospace"><span style="color:rgb(0,0,0)">systemctl start postgresql</span><br></span></div><div><span style="font-family:monospace"><span style="color:rgb(0,0,0)"><br></span></span></div><div>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.</div>
</div></div></div>
</blockquote></div><br></div>