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 Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:15 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Levente Polyak (anthraxx)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
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:

[Service]
User=pgbouncer
PermissionsStartOnly=true
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:

[Unit]
Description=A lightweight connection pooler for PostgreSQL
After=network.target
After=postgresql.service
Wants=postgresql.service

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

Closed by  Buggy McBugFace (bugbot)
Saturday, 25 November 2023, 20:15 GMT
Reason for closing:  Moved
Additional comments about closing:  https://gitlab.archlinux.org/archlinux/p ackaging/packages/pgbouncer/issues/1
Comment by Buggy McBugFace (bugbot) - Tuesday, 08 August 2023, 19:11 GMT
This is an automated comment as this bug is open for more then 2 years. Please reply if you still experience this bug otherwise this issue will be closed after 1 month.

Loading...