Re: Patroni 4.1.0 causes issues because of systemd notify

From: Richard Huxton <richard(at)huxton(dot)org(dot)uk>
To: pgsql-pkg-debian(at)lists(dot)postgresql(dot)org
Subject: Re: Patroni 4.1.0 causes issues because of systemd notify
Date: 2025-11-06 20:34:06
Message-ID: ea1c371415349429e65a28cdfedb516c@huxton.org.uk
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-pkg-debian

On 2025-10-22 17:16, Hauke Bruno Wollentin wrote:
> Hi all,
>
> while spinning up new Patroni cluster with version 4.1.0 (which has
> been added to the Debian repo 2 days ago), my clusters won’t bootstrap
> properly anymore.
>
> At first, logs looks clear but anyways, all systemd operations like
> start/stop/restart will run into a timeout, causing the service to stop
> which then will break the cluster at all.
>
> It seems like the new systemd notify feature is causing this, since
> using Patroni 4.0.7 with `Type=simple` in the systemd unit file works
> pretty fine.

I think you may well be right - it seems that patroni is sending the
notify from a forked child process and that isn't what systemd is
expecting

> Oct 22 17:43:09 hetzner-lab01 systemd[1]: patroni.service: Got
> notification message from PID 13083, but reception only permitted for
> main PID 13059

> Any recommendations how to fix/workaround this?

https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html#NotifyAccess=

I don't have a test patroni installation handy right now, but I think if
you set

NotifyAccess=all

in the service config (which you should be able to do by creating a file
with just that line called `/etc/systemd/system/patroni/override.conf`)

It defaults to "main" IIRC which is the most restricted, "exec" might
work, but "all" (the least restricted) seems the most likely to work
first time.

Hopefully that will do the trick. If so, maybe try "exec" then and let
the list know which works and the package can be updated.

--
Richard Huxton

In response to

Browse pgsql-pkg-debian by date

  From Date Subject
Next Message apt.postgresql.org Repository Update 2025-11-06 22:01:04 pg-statviz updated to version 0.8-1.pgdg+1
Previous Message apt.postgresql.org Repository Update 2025-11-06 14:21:00 postgis updated to version 3.6.0+dfsg-3.pgdg+1