| 1 |
[Unit] |
| 2 |
Description=Backup and Recovery Manager for PostgreSQL - WAL streaming receiver for %i |
| 3 |
Documentation=man:barman(1) |
| 4 |
After=network.target |
| 5 |
# Keep retrying for as long as the server is configured, like the previous |
| 6 |
# cron-based supervision did, instead of giving up after the default |
| 7 |
# start-limit burst when PostgreSQL is temporarily unreachable. |
| 8 |
StartLimitIntervalSec=0 |
| 9 |
|
| 10 |
[Service] |
| 11 |
Type=simple |
| 12 |
# Type=simple reports "active" as soon as the process is exec'd, before it has |
| 13 |
# connected to PostgreSQL: "systemctl is-active" means the receiver is running, |
| 14 |
# not that WAL is streaming. Use "barman check" to confirm streaming. |
| 15 |
User=barman |
| 16 |
ExecStart=/usr/bin/barman -q receive-wal %i |
| 17 |
# Stop the receiver the way barman itself does: it traps SIGINT and exits |
| 18 |
# cleanly (0), whereas the default SIGTERM is not caught and would leave the |
| 19 |
# unit in a "failed" state (exit 143) on every normal stop. |
| 20 |
KillSignal=SIGINT |
| 21 |
# A clean SIGINT stop exits 0 and must stay stopped; an error exit (e.g. |
| 22 |
# PostgreSQL temporarily unreachable) is retried (forever, via |
| 23 |
# StartLimitIntervalSec=0 above). |
| 24 |
Restart=on-failure |
| 25 |
RestartSec=10 |
| 26 |
|
| 27 |
# Instances are started/stopped on demand by `barman cron`, so this template is |
| 28 |
# intentionally not enabled at boot (no [Install] section). |