summaryrefslogtreecommitdiffstats
path: root/postgresql.service.in
blob: ad0a3e1b3c602d55c1455674e0f0961a2fb53d34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# It's not recommended to modify this file in-place, because it will be
# overwritten during package upgrades.  If you want to customize, the
# best way is to edit configuration file /etc/postgresql/$SERVICE_NAME
# (where by default, SERVICE_NAME is postgresql).

[Unit]
Description=PostgreSQL database server
After=network.target

[Service]
Type=forking

User=postgres
Group=postgres

EnvironmentFile=-@PKGCONFIG_DIR@/%N

# Where to send early-startup messages from the server (before the logging
# options of postgresql.conf take effect)
# This is normally controlled by the global default set by systemd
# StandardOutput=syslog

# Disable OOM kill on the postmaster
OOMScoreAdjust=-1000
# ... but allow it still to be effective for child processes
# (note that these settings are ignored by Postgres releases before 9.5)
Environment=PG_OOM_ADJUST_FILE=/proc/self/oom_score_adj
Environment=PG_OOM_ADJUST_VALUE=0

ExecStartPre=@libexecdir@/postgresql-check-db-dir ${PGDATA}

# Temporarily use postgresql-ctl wrapper around pg_ctl until there will
# exist clients which set PGPORT in service file.
ExecStart=@libexecdir@/postgresql-ctl start -D ${PGDATA} -s -w -t 300
ExecStop=/usr/bin/pg_ctl stop -D ${PGDATA} -s -m fast
ExecReload=/usr/bin/pg_ctl reload -D ${PGDATA} -s

# Give a reasonable amount of time for the server to start up/shut down
TimeoutSec=300

[Install]
WantedBy=multi-user.target