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