[Unit]Description=PostgreSQL 9.4 database server
Documentation=https://www.postgresql.org/docs/9.4/static/
After=syslog.target
After=network.target
[Service]Type=forking
User=postgres
Group=postgres
# Note: avoid inserting whitespace in these Environment= lines, or you may# break postgresql-setup.# Location of database directoryEnvironment=PGDATA=/data/postgresql/
# 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 postmasterOOMScoreAdjust=-1000
ExecStart=/application/pgsql/bin/pg_ctl start -D ${PGDATA} -s -w -t 300ExecStop=/application/pgsql/bin/pg_ctl stop -D ${PGDATA} -s -m fast
ExecReload=/application/pgsql/bin/pg_ctl reload -D ${PGDATA} -s
# Do not set any timeout value, so that systemd will not kill postmaster# during crash recovery.TimeoutSec=0[Install]WantedBy=multi-user.target