]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/blame - modules/profile/templates/postgresql/postgresql_backup@.service.erb
Refactor backup postgresql
[perso/Immae/Projets/Puppet.git] / modules / profile / templates / postgresql / postgresql_backup@.service.erb
CommitLineData
6d1c9c43
IB
1[Unit]
2Description=PostgreSQL database server
3After=network.target
4
5[Service]
6Type=forking
7TimeoutSec=120
8User=postgres
9Group=postgres
10
d2f031ec 11Environment=PGROOT=<%= @base_path %>/%i/postgresql
6d1c9c43
IB
12
13SyslogIdentifier=postgres
d2f031ec 14PIDFile=<%= @base_path %>/%i/postgresql/postmaster.pid
6d1c9c43
IB
15RuntimeDirectory=postgresql
16RuntimeDirectoryMode=755
17
18ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGROOT}
19ExecStart= /usr/bin/pg_ctl -s -D ${PGROOT} start -w -t 120
20ExecReload=/usr/bin/pg_ctl -s -D ${PGROOT} reload
21ExecStop= /usr/bin/pg_ctl -s -D ${PGROOT} stop -m fast
22
23# Due to PostgreSQL's use of shared memory, OOM killer is often overzealous in
24# killing Postgres, so adjust it downward
25OOMScoreAdjust=-200
26
27# Additional security-related features
28PrivateTmp=true
29ProtectHome=true
30ProtectSystem=full
31NoNewPrivileges=true
32
33[Install]
34WantedBy=multi-user.target