Reloading pgbouncer and systemd

From: Jehan-Guillaume de Rorthais <jgdr(at)dalibo(dot)com>
To: pgsql-pkg-yum(at)postgresql(dot)org
Subject: Reloading pgbouncer and systemd
Date: 2016-02-22 16:38:45
Message-ID: 20160222173845.5966807b@firost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-pkg-yum

Hello,

While working with pgbouncer under CentOS7, I noticed an incompatibility
between pgbouncer and systemd when reloading.

The current reload command is:

ExecReload=/usr/bin/pgbouncer -R -q ${BOUNCERCONF}

But this command create a new pgbouncer process...and keeps it in foreground.
As the service type is set as "forking", in this situation systemctl just sits
and wait for a return code (maybe there's a timeout, but I did not have the
patience to wait for it).

Either add a '-d' to this command, or send a HUP signal to the process.

I prefer the second option as it doesn't create a new process that takes over
the sockets, but just reloads the conf file as expected. Much lighter.

So, imho, the pgbouncer.service file should have:

ExecReload=/bin/kill -HUP $MAINPID

Regards
--
Jehan-Guillaume de Rorthais
Dalibo

Responses

Browse pgsql-pkg-yum by date

  From Date Subject
Next Message Kazuki Uehara 2016-02-22 23:58:00 Re: yum package for orafce 3.2.1
Previous Message Michael Gauthier 2016-02-19 18:33:55 Re: Insecure instructions for installing YUM repo