summaryrefslogtreecommitdiff
path: root/meta-openembedded/meta-oe/recipes-dbs/postgresql/files/postgresql.service
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openembedded/meta-oe/recipes-dbs/postgresql/files/postgresql.service')
-rw-r--r--meta-openembedded/meta-oe/recipes-dbs/postgresql/files/postgresql.service27
1 files changed, 27 insertions, 0 deletions
diff --git a/meta-openembedded/meta-oe/recipes-dbs/postgresql/files/postgresql.service b/meta-openembedded/meta-oe/recipes-dbs/postgresql/files/postgresql.service
new file mode 100644
index 000000000..4ec959e84
--- /dev/null
+++ b/meta-openembedded/meta-oe/recipes-dbs/postgresql/files/postgresql.service
@@ -0,0 +1,27 @@
+[Unit]
+Description=PostgreSQL database server
+After=network.target
+
+[Service]
+Type=forking
+User=postgres
+Group=postgres
+
+# Port number for server to listen on
+Environment=PGPORT=5432
+
+# Location of database directory
+Environment=PGDATA=/var/lib/postgresql/data
+
+# Disable OOM kill on the postmaster
+OOMScoreAdjust=-17
+
+ExecStart=@BINDIR@/pg_ctl start -D ${PGDATA} -s -o "-p ${PGPORT}" -w -t 300
+ExecStop=@BINDIR@/pg_ctl stop -D ${PGDATA} -s -m fast
+ExecReload=@BINDIR@/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