dev-db/postgresql: Handle RuntimeDirectory in systemd unit
authorElias Probst <mail@eliasprobst.eu>
Fri, 23 Oct 2015 21:25:09 +0000 (23:25 +0200)
committerElias Probst <mail@eliasprobst.eu>
Sun, 25 Oct 2015 19:45:00 +0000 (20:45 +0100)
Instead of using a separate `tmpfiles.d` definition to create
`/run/postgresql`, let the service unit take care of it on its
own. This prevents situations where the postgresql service can't
start because `systemd-tmpfiles` wasn't run yet.

Bug: https://bugs.gentoo.org/show_bug.cgi?id=563122

Package-Manager: portage-2.2.23

dev-db/postgresql/files/postgresql.service
dev-db/postgresql/files/postgresql.tmpfilesd [deleted file]
dev-db/postgresql/postgresql-9.0.23-r1.ebuild [moved from dev-db/postgresql/postgresql-9.0.23.ebuild with 99% similarity]
dev-db/postgresql/postgresql-9.1.19-r1.ebuild [moved from dev-db/postgresql/postgresql-9.1.19.ebuild with 99% similarity]
dev-db/postgresql/postgresql-9.2.14-r1.ebuild [moved from dev-db/postgresql/postgresql-9.2.14.ebuild with 99% similarity]
dev-db/postgresql/postgresql-9.3.10-r1.ebuild [moved from dev-db/postgresql/postgresql-9.3.10.ebuild with 99% similarity]
dev-db/postgresql/postgresql-9.4.5-r1.ebuild [moved from dev-db/postgresql/postgresql-9.4.5.ebuild with 99% similarity]
dev-db/postgresql/postgresql-9.5_beta1-r1.ebuild [moved from dev-db/postgresql/postgresql-9.5_beta1.ebuild with 99% similarity]
dev-db/postgresql/postgresql-9999.ebuild

index 20ed27a10f297a5708c11aaa51d5748e9141b069..a607169d22f4e0bedbf3655298c1637ea08edb6f 100644 (file)
@@ -47,5 +47,9 @@ 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
diff --git a/dev-db/postgresql/files/postgresql.tmpfilesd b/dev-db/postgresql/files/postgresql.tmpfilesd
deleted file mode 100644 (file)
index 26f44ef..0000000
+++ /dev/null
@@ -1 +0,0 @@
-d /run/postgresql 1775 postgres postgres -
similarity index 99%
rename from dev-db/postgresql/postgresql-9.0.23.ebuild
rename to dev-db/postgresql/postgresql-9.0.23-r1.ebuild
index 174a686213e48ac307e066e8d1bd5f13fc585917..ac1b4fe859aa28b5a9e938de183bc2cb5876f949 100644 (file)
@@ -198,8 +198,6 @@ src_install() {
                        "${FILESDIR}/${PN}.service" | \
                        systemd_newunit - ${PN}-${SLOT}.service
 
-               systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfilesd ${PN}-${SLOT}.conf
-
                newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
 
                use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
similarity index 99%
rename from dev-db/postgresql/postgresql-9.1.19.ebuild
rename to dev-db/postgresql/postgresql-9.1.19-r1.ebuild
index e2ab37ede1c9996761da7c72ab3670c47e01fd34..817622c4a539f576d7aa967635e7db7a32ba36c5 100644 (file)
@@ -202,8 +202,6 @@ src_install() {
                        "${FILESDIR}/${PN}.service" | \
                        systemd_newunit - ${PN}-${SLOT}.service
 
-               systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfilesd ${PN}-${SLOT}.conf
-
                newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
 
                use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
similarity index 99%
rename from dev-db/postgresql/postgresql-9.2.14.ebuild
rename to dev-db/postgresql/postgresql-9.2.14-r1.ebuild
index 6ec39d36a7464e5f686cf65fd8e1df0a9dab40fc..83a2fa7543ce851f098e06891edbf219930be279 100644 (file)
@@ -196,8 +196,6 @@ src_install() {
                        "${FILESDIR}/${PN}.service" | \
                        systemd_newunit - ${PN}-${SLOT}.service
 
-               systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfilesd ${PN}-${SLOT}.conf
-
                newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
 
                use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
similarity index 99%
rename from dev-db/postgresql/postgresql-9.3.10.ebuild
rename to dev-db/postgresql/postgresql-9.3.10-r1.ebuild
index dc084ca55d17a6d48108bdaa25d5f936221df6a6..2367c975064a1cde98202fd3dbc681cb63898cd8 100644 (file)
@@ -196,8 +196,6 @@ src_install() {
                        "${FILESDIR}/${PN}.service" | \
                        systemd_newunit - ${PN}-${SLOT}.service
 
-               systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfilesd ${PN}-${SLOT}.conf
-
                newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
 
                use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
similarity index 99%
rename from dev-db/postgresql/postgresql-9.4.5.ebuild
rename to dev-db/postgresql/postgresql-9.4.5-r1.ebuild
index a411b3837669f94d10ef39cca1d597f9e03f0f86..d705b10038116485182317b67d9ff4f8495a0dfa 100644 (file)
@@ -228,8 +228,6 @@ src_install() {
                        "${FILESDIR}/${PN}.service" | \
                        systemd_newunit - ${PN}-${SLOT}.service
 
-               systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfilesd ${PN}-${SLOT}.conf
-
                newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
 
                use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
similarity index 99%
rename from dev-db/postgresql/postgresql-9.5_beta1.ebuild
rename to dev-db/postgresql/postgresql-9.5_beta1-r1.ebuild
index 50d2cecefa659f252434d9ca1be8f00da3302fdd..cc14882a351c03f0a4ca6e834d83c216d8d4ffc7 100644 (file)
@@ -234,8 +234,6 @@ src_install() {
                        "${FILESDIR}/${PN}.service" | \
                        systemd_newunit - ${PN}-${SLOT}.service
 
-               systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfilesd ${PN}-${SLOT}.conf
-
                newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
 
                use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
index 36e35fdb8ba3d05265d3f224413a46187675dadc..c2fe866097b02936f8d201cd9ab560d97456cdf2 100644 (file)
@@ -186,8 +186,6 @@ src_install() {
                "${FILESDIR}/${PN}.service" | \
                systemd_newunit - ${PN}-${SLOT}.service
 
-       systemd_newtmpfilesd "${FILESDIR}"/${PN}.tmpfilesd ${PN}-${SLOT}.conf
-
        newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
 
        use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session