summaryrefslogtreecommitdiffstats
path: root/postgresql.service.in
diff options
context:
space:
mode:
authorPavel Raiskup <praiskup@redhat.com>2014-07-01 11:01:03 +0200
committerPavel Raiskup <praiskup@redhat.com>2014-07-01 11:01:03 +0200
commit8c49d3b08882c0c5a6bd546fd5bf0a14e68b3357 (patch)
tree845c5837566dafec8d5945f09115bc278175e856 /postgresql.service.in
parent00683dad1a27a49e99f4a28e3924e1c97b1b9594 (diff)
downloadpostgresql-setup-8c49d3b08882c0c5a6bd546fd5bf0a14e68b3357.tar.gz
postgresql-setup-8c49d3b08882c0c5a6bd546fd5bf0a14e68b3357.tar.xz
postgresql-setup-8c49d3b08882c0c5a6bd546fd5bf0a14e68b3357.zip
Generate postgresql.service and configuration file
Diffstat (limited to 'postgresql.service.in')
-rw-r--r--postgresql.service.in42
1 files changed, 42 insertions, 0 deletions
diff --git a/postgresql.service.in b/postgresql.service.in
new file mode 100644
index 0000000..c865bcc
--- /dev/null
+++ b/postgresql.service.in
@@ -0,0 +1,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@/%p
+
+# 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=/usr/bin/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