diff options
author | Aaron W. Swenson <titanofold@gentoo.org> | 2013-06-09 01:26:45 +0000 |
---|---|---|
committer | Aaron W. Swenson <titanofold@gentoo.org> | 2013-06-09 01:26:45 +0000 |
commit | c396a16455a37644a77de10ac4f022410371c345 (patch) | |
tree | 571ae7336158690f371516a5d0bb40adf476e00a | |
parent | Change security definition. (diff) | |
download | patches-c396a16455a37644a77de10ac4f022410371c345.tar.gz patches-c396a16455a37644a77de10ac4f022410371c345.tar.bz2 patches-c396a16455a37644a77de10ac4f022410371c345.zip |
New systemd files
Add systemd unit
https://bugs.gentoo.org/show_bug.cgi?id=468868
-rw-r--r-- | postgresql.service | 51 | ||||
-rw-r--r-- | postgresql.tmpfilesd | 1 |
2 files changed, 52 insertions, 0 deletions
diff --git a/postgresql.service b/postgresql.service new file mode 100644 index 0000000..3d70197 --- /dev/null +++ b/postgresql.service @@ -0,0 +1,51 @@ +# 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 + +# Disable OOM kill on the postmaster +OOMScoreAdjust=-1000 + +#ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGDATA} +ExecStart=/usr/lib/postgresql-@SLOT@/bin/pg_ctl start -D ${PGDATA} -s -l ${DATA_DIR}/postmaster.log -o "-p ${PGPORT} --data-directory=${DATA_DIR}" -w -t 300 +ExecStop=/usr/lib/postgresql-@SLOT@/bin/pg_ctl stop -D ${PGDATA} -s -m fast -o "--data-directory=${DATA_DIR}" +ExecReload=/usr/lib/postgresql-@SLOT@/bin/pg_ctl reload -D ${PGDATA} -s -o "--data-directory=${DATA_DIR}" + +# Give a reasonable amount of time for the server to start up/shut down +TimeoutSec=300 + +[Install] +WantedBy=multi-user.target diff --git a/postgresql.tmpfilesd b/postgresql.tmpfilesd new file mode 100644 index 0000000..c2e0747 --- /dev/null +++ b/postgresql.tmpfilesd @@ -0,0 +1 @@ +d /run/postgresql 0775 postgres postgres - |