core/postgresql/postgresql.service

27 lines
668 B
SYSTEMD
Raw Normal View History

2012-06-23 23:38:19 +08:00
[Unit]
Description=PostgreSQL database server
2014-02-11 22:26:21 +08:00
After=network.target
2012-06-23 23:38:19 +08:00
[Service]
Type=forking
2014-02-11 22:26:21 +08:00
TimeoutSec=120
User=postgres
Group=postgres
Environment=PGROOT=/var/lib/postgres
2012-06-23 23:38:19 +08:00
SyslogIdentifier=postgres
PIDFile=/var/lib/postgres/data/postmaster.pid
2014-02-11 22:26:21 +08:00
ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGROOT}/data
ExecStart= /usr/bin/pg_ctl -s -D ${PGROOT}/data start -w -t 120
ExecReload=/usr/bin/pg_ctl -s -D ${PGROOT}/data reload
ExecStop= /usr/bin/pg_ctl -s -D ${PGROOT}/data stop -m fast
2012-06-23 23:38:19 +08:00
# Due to PostgreSQL's use of shared memory, OOM killer is often overzealous in
2014-02-11 22:26:21 +08:00
# killing Postgres, so adjust it downward
2012-06-23 23:38:19 +08:00
OOMScoreAdjust=-200
[Install]
WantedBy=multi-user.target