pgbouncer/templates/pgbouncer.service.j2
2023-02-08 02:34:53 +03:00

28 lines
739 B
Django/Jinja

[Unit]
Description=pgBouncer connection pooling for PostgreSQL
After=syslog.target network.target
[Service]
Type=forking
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 }}
{% 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
Restart=on-failure
LimitNOFILE=100000
[Install]
WantedBy=multi-user.target