diff options
| author | Thomas Deutschmann <whissi@gentoo.org> | 2018-02-11 23:56:24 +0100 |
|---|---|---|
| committer | Thomas Deutschmann <whissi@gentoo.org> | 2018-02-12 00:05:50 +0100 |
| commit | d5021b6ede0f88dfa2eab505d0a163ec22419679 (patch) | |
| tree | f1587d9b2fbd216031c0f95f550f0862851ac7a7 /dev-db/postgresql/files/postgresql.service | |
| parent | 95345df41ce46c863004fae12baa0bbb3626fd36 (diff) | |
| download | gentoo-d5021b6ede0f88dfa2eab505d0a163ec22419679.tar.gz gentoo-d5021b6ede0f88dfa2eab505d0a163ec22419679.tar.bz2 gentoo-d5021b6ede0f88dfa2eab505d0a163ec22419679.zip | |
Revert "dev-db/postgresql: Cleanup Old and Insecure Files"
This reverts commit 850efe2a5700c2ba30f9e9860dd83143cf15da34.
Diffstat (limited to 'dev-db/postgresql/files/postgresql.service')
| -rw-r--r-- | dev-db/postgresql/files/postgresql.service | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/dev-db/postgresql/files/postgresql.service b/dev-db/postgresql/files/postgresql.service new file mode 100644 index 000000000000..a607169d22f4 --- /dev/null +++ b/dev-db/postgresql/files/postgresql.service @@ -0,0 +1,55 @@ +# 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 create file +# "/etc/systemd/system/postgresql-@SLOT@.service.d/*.conf" +# containing your changes + +# For example, if you want to change the server's port number to 5433, +# create a file named +# "/etc/systemd/system/postgresql-@SLOT@.service.d/port.conf" +# containing: +# [Service] +# Environment=PGPORT=5433 +# This will override the setting appearing below. + +[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 configuration files +Environment=PGDATA=/etc/postgresql-@SLOT@ + +# Where the data directory is located +Environment=DATA_DIR=/var/lib/postgresql/@SLOT@/data + +# 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 + +ExecStartPre=/usr/bin/postgresql-@SLOT@-check-db-dir +ExecStart=/usr/@LIBDIR@/postgresql-@SLOT@/bin/pg_ctl start -D ${DATA_DIR} -s -l ${DATA_DIR}/postmaster.log -o "-p ${PGPORT} -D ${PGDATA} --data-directory=${DATA_DIR}" -w -t 300 +ExecStop=/usr/@LIBDIR@/postgresql-@SLOT@/bin/pg_ctl stop -D ${DATA_DIR} -s -m fast +ExecReload=/usr/@LIBDIR@/postgresql-@SLOT@/bin/pg_ctl reload -D ${DATA_DIR} -s + +# Give a reasonable amount of time for the server to start up/shut down +TimeoutSec=300 + +# Disable OOM kill on the postmaster +OOMScoreAdjust=-1000 + +# Make sure the required runtimedir is present +RuntimeDirectory=postgresql +RuntimeDirectoryMode=1775 + +[Install] +WantedBy=multi-user.target |
