File: //usr/lib/systemd/system/pgbouncer.service
# It's not recommended to modify this file in-place, because it will be
# overwritten during package upgrades. It is recommended to use systemd
# "dropin" feature; i.e. create file with suffix .conf under
# /etc/systemd/system/pgbouncer.service.d directory overriding the
# unit's defaults. You can also use "systemctl edit pgbouncer"
# Look at systemd.unit(5) manual page for more info.
[Unit]
Description=A lightweight connection pooler for PostgreSQL
After=syslog.target
After=network.target
[Service]
RemainAfterExit=yes
User=pgbouncer
Group=pgbouncer
# Path to the init file
Environment=BOUNCERCONF=/etc/pgbouncer/pgbouncer.ini
PIDFile=/var/run/pgbouncer/pgbouncer.pid
# Where to send early-startup messages from the server
# This is normally controlled by the global default set by systemd
# StandardOutput=syslog
ExecStart=/usr/bin/pgbouncer ${BOUNCERCONF}
ExecReload=/usr/bin/kill -HUP $MAINPID
KillSignal=SIGINT
# Give a reasonable amount of time for the server to start up/shut down
TimeoutSec=300
[Install]
WantedBy=multi-user.target