diff options
author | Ariel Popper | 2016-02-14 10:27:31 -0500 |
---|---|---|
committer | Ariel Popper | 2016-02-14 10:27:31 -0500 |
commit | 737b1f91cb110f9f93c2ec1a052a672a795641c2 (patch) | |
tree | eee7a87ce6d8e484c648f46591957d64344e27d3 /postgresql.service | |
download | aur-737b1f91cb110f9f93c2ec1a052a672a795641c2.tar.gz |
9.4.6
Diffstat (limited to 'postgresql.service')
-rw-r--r-- | postgresql.service | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/postgresql.service b/postgresql.service new file mode 100644 index 000000000000..f4a871ad61a1 --- /dev/null +++ b/postgresql.service @@ -0,0 +1,31 @@ +[Unit] +Description=PostgreSQL database server +After=network.target + +[Service] +Type=forking +TimeoutSec=120 +User=postgres +Group=postgres + +Environment=PGROOT=/var/lib/postgres + +SyslogIdentifier=postgres +PIDFile=/var/lib/postgres/data/postmaster.pid + +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 + +# Due to PostgreSQL's use of shared memory, OOM killer is often overzealous in +# killing Postgres, so adjust it downward +OOMScoreAdjust=-200 + +# Additional security-related features +PrivateTmp=true +ProtectSystem=full +NoNewPrivileges=true + +[Install] +WantedBy=multi-user.target |