summaryrefslogtreecommitdiffstats
path: root/systemd/system/pg_receivewal@.service
blob: a15b4323ab39521d10418650014eae2e18f2bc41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[Unit]
Description=WAL archival of PostgreSQL Cluster %i
AssertPathExists=/etc/postgresql/%I/postgresql.conf
Wants=postgresql@%i.service
After=postgresql@%i.service
RequiresMountsFor=/var/backups/postgresql

[Service]
Type=simple
User=postgres
ExecStartPre=+/usr/bin/pg_backupcluster %i createdirectory
ExecStart=/usr/bin/pg_backupcluster %i receivewal
Restart=on-failure
RestartSec=1min
# pg_receivewal only flushes compressed output on SIGINT
# (https://www.postgresql.org/message-id/flat/Yvo/5No5S0c4EFMj%40msg.df7cb.de)
KillSignal=SIGINT

[Install]
# when enabled, start along with postgresql@%i
WantedBy=postgresql@%i.service