Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#54668 - [pgbouncer] startup with socket in /run/postgresql needs TLC

Attached to Project: Arch Linux
Opened by Richard PALO (risto3) - Monday, 03 July 2017, 05:09 GMT
Last edited by Jelle van der Waa (jelly) - Sunday, 13 September 2020, 11:53 GMT
Task Type Bug Report
Category Packages: Extra
Status Assigned
Assigned To Levente Polyak (anthraxx)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


For simplicity, it seems a good place to create the socket in /run/postgresql
but by default the directory is read-only meaning pgbouncer startup fails.

Additional info:
* package version(s)
* config and/or log files etc.

For the case where postgresql is enabled and started on the same machine,
I could not seem to get a modified tmpfiles.d/pgbouncer.conf to work adding
an ACL, but I could modify as follows the pgbouncer.service:

ExecStartPre=/bin/setfacl -m "user:pgbouncer:rwx" /run/postgresql
ExecStart=/usr/bin/pgbouncer /etc/pgbouncer/pgbouncer.ini
ExecReload=/bin/kill -HUP $MAINPID

Subsequently I also modified the following to ensure an optional startup
dependency and ordering after the postgresql.service:

Description=A lightweight connection pooler for PostgreSQL

This may not be the best global solution, the more general and probable case
of pgbouncer is its being installed on other than a postgresql server machine
so there is perhaps need to create the default /run/postgresql directory as well.

Also, using the ACL on our system seemed saner than giving, for example,
group access and adding pgbouncer to the postgresql group (though I did start
by doing just that... it may be indeed a somewhat better global solution).

Not *that* experienced with systemd, I didn't spend much time trying to figure
out why adding an ACL with 'a+' didn't work for me with tmpfiles.d/pgbouncer.conf,
but a knowlegeable developer may come up with something more robust there.

This task depends upon