summaryrefslogtreecommitdiff
path: root/testing/postgresql/postgresql.service
blob: 2fcd3e93d381e9c7ae9459dfe8dd02c5a0c05456 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
[Unit]
Description=PostgreSQL database server

[Service]
Type=forking
SyslogIdentifier=postgres
PIDFile=/var/lib/postgres/data/postmaster.pid

# initdb script takes care for symlinking $PGROOT to /var/lib/postgres
ExecStartPre=/usr/lib/systemd/scripts/postgresql-initdb
ExecStart= /bin/su - postgres -m -c "/usr/bin/pg_ctl -s -D /var/lib/postgres/data start"
ExecReload=/bin/su - postgres -m -c "/usr/bin/pg_ctl -s -D /var/lib/postgres/data reload"
ExecStop=  /bin/su - postgres -m -c "/usr/bin/pg_ctl -s -D /var/lib/postgres/data stop -m fast"

# Due to PostgreSQL's use of shared memory, OOM killer is often overzealous in
# killing Postgres
OOMScoreAdjust=-200

[Install]
WantedBy=multi-user.target