aboutsummaryrefslogtreecommitdiff
path: root/modules/role/templates/cryptoportfolio/postgresql_backup@.service.erb
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2018-05-13 16:54:03 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2018-05-14 00:36:43 +0200
commit6d1c9c43fb2133689d814cfc84a4942ceec5c1c7 (patch)
treefbbaec6a735433be8d1da2c949df9ea50fe97539 /modules/role/templates/cryptoportfolio/postgresql_backup@.service.erb
parenta859ab30660104d25485824afa1c23de454bb5ed (diff)
downloadPuppet-6d1c9c43fb2133689d814cfc84a4942ceec5c1c7.tar.gz
Puppet-6d1c9c43fb2133689d814cfc84a4942ceec5c1c7.tar.zst
Puppet-6d1c9c43fb2133689d814cfc84a4942ceec5c1c7.zip
Add cryptoportfolio postgresql backup
Diffstat (limited to 'modules/role/templates/cryptoportfolio/postgresql_backup@.service.erb')
-rw-r--r--modules/role/templates/cryptoportfolio/postgresql_backup@.service.erb34
1 files changed, 34 insertions, 0 deletions
diff --git a/modules/role/templates/cryptoportfolio/postgresql_backup@.service.erb b/modules/role/templates/cryptoportfolio/postgresql_backup@.service.erb
new file mode 100644
index 0000000..245a1cb
--- /dev/null
+++ b/modules/role/templates/cryptoportfolio/postgresql_backup@.service.erb
@@ -0,0 +1,34 @@
1[Unit]
2Description=PostgreSQL database server
3After=network.target
4
5[Service]
6Type=forking
7TimeoutSec=120
8User=postgres
9Group=postgres
10
11Environment=PGROOT=<%= @mountpoint %>/%i/postgresql
12
13SyslogIdentifier=postgres
14PIDFile=<%= @mountpoint %>/%i/postgresql/postmaster.pid
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