Skip to content

Commit

Permalink
pgbouncer: update the path to the pid file to /run/pgbouncer/pgbounce…
Browse files Browse the repository at this point in the history
…r.pid

Fixed:
/etc/systemd/system/pgbouncer.service:16: PIDFile= references a path below legacy directory /var/run/, updating /run/pgbouncer/pgbouncer.pid → /run/pgbouncer/pgbouncer.pid; please update the unit file accordingly.
  • Loading branch information
vitabaks committed Jan 25, 2023
1 parent 12c676b commit 4f1d890
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion roles/pgbouncer/templates/pgbouncer.ini.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

[pgbouncer]
logfile = {{ pgbouncer_log_dir }}/pgbouncer.log
pidfile = /var/run/pgbouncer/pgbouncer.pid
pidfile = /run/pgbouncer/pgbouncer.pid
{% if not with_haproxy_load_balancing|bool and cluster_vip is defined and cluster_vip | length > 0 %}
listen_addr = {{ hostvars[inventory_hostname]['inventory_hostname'] }},{{ cluster_vip }}
{% else %}
Expand Down
6 changes: 3 additions & 3 deletions roles/pgbouncer/templates/pgbouncer.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ User=postgres
Group=postgres

PermissionsStartOnly=true
ExecStartPre=-/bin/mkdir -p /var/run/pgbouncer {{ pgbouncer_log_dir }}
ExecStartPre=/bin/chown -R postgres:postgres /var/run/pgbouncer {{ pgbouncer_log_dir }}
ExecStartPre=-/bin/mkdir -p /run/pgbouncer {{ pgbouncer_log_dir }}
ExecStartPre=/bin/chown -R postgres:postgres /run/pgbouncer {{ pgbouncer_log_dir }}
{% if ansible_os_family == "Debian" %}
ExecStart=/usr/sbin/pgbouncer -d {{ pgbouncer_conf_dir }}/pgbouncer.ini
{% endif %}
{% if ansible_os_family == "RedHat" %}
ExecStart=/usr/bin/pgbouncer -d {{ pgbouncer_conf_dir }}/pgbouncer.ini
{% endif %}
ExecReload=/bin/kill -SIGHUP $MAINPID
PIDFile=/var/run/pgbouncer/pgbouncer.pid
PIDFile=/run/pgbouncer/pgbouncer.pid
Restart=on-failure

LimitNOFILE=100000
Expand Down

0 comments on commit 4f1d890

Please sign in to comment.