Add initial meta-stx to support StarlingX build
[pti/rtp.git] / meta-stx / recipes-support / puppet / files / puppetlabs-postgresql / postgresql.service
diff --git a/meta-stx/recipes-support/puppet/files/puppetlabs-postgresql/postgresql.service b/meta-stx/recipes-support/puppet/files/puppetlabs-postgresql/postgresql.service
new file mode 100644 (file)
index 0000000..3b4c5ca
--- /dev/null
@@ -0,0 +1,22 @@
+[Unit]
+Description=PostgreSQL database server
+After=network.target
+
+[Install]
+WantedBy=multi-user.target
+
+[Service]
+Type=forking
+User=postgres
+Group=postgres
+# Disable OOM kill on the postmaster
+OOMScoreAdjust=-17
+
+PermissionsStartOnly=true
+ExecStartPre=-/etc/postgresql/postgresql-init initdb
+ExecStart=/usr/bin/pg_ctl start -D ${PGDATA} -s -o "-p ${PGPORT}" -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