diff options
author | Tom Lane <tgl@redhat.com> | 2011-07-27 19:32:24 -0400 |
---|---|---|
committer | Tom Lane <tgl@redhat.com> | 2011-07-27 19:32:24 -0400 |
commit | 2932c3bfdd1c3c420742d770ab7b96705aaae402 (patch) | |
tree | 3059b700a704696c32364ccae939bf2ac4dc12f5 /postgresql.service | |
parent | 69792bd882f692343633563056788d59493d0b80 (diff) | |
download | postgresql-setup-2932c3bfdd1c3c420742d770ab7b96705aaae402.tar.gz postgresql-setup-2932c3bfdd1c3c420742d770ab7b96705aaae402.tar.xz postgresql-setup-2932c3bfdd1c3c420742d770ab7b96705aaae402.zip |
Convert to systemd startup support
Diffstat (limited to 'postgresql.service')
-rw-r--r-- | postgresql.service | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/postgresql.service b/postgresql.service new file mode 100644 index 0000000..0c733bd --- /dev/null +++ b/postgresql.service @@ -0,0 +1,36 @@ +[Unit] +Description=PostgreSQL database server +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. + +# Port number for server to listen on +Environment=PGPORT=5432 + +# Location of database directory +Environment=PGDATA=/var/lib/pgsql/data + +# Where to send early-startup messages from the server (before the logging +# options of postgresql.conf take effect) +StandardOutput=syslog + +# Disable OOM kill on the postmaster +OOMScoreAdjust=-1000 + +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 + +[Install] +WantedBy=multi-user.target |