commit:     fcbcf021f60f4b37927e6f6b433bc7ac57e0a72f
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 24 12:34:26 2020 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Mon Aug 24 12:36:41 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fcbcf021

sys-fs/lvm2: try to detect and warn for problematic /run permissions

Bug: https://bugs.gentoo.org/737270
Package-Manager: Portage-3.0.4, Repoman-3.0.1
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 sys-fs/lvm2/lvm2-2.02.187-r2.ebuild | 16 ++++++++++++++++
 sys-fs/lvm2/lvm2-2.03.10.ebuild     | 16 ++++++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/sys-fs/lvm2/lvm2-2.02.187-r2.ebuild 
b/sys-fs/lvm2/lvm2-2.02.187-r2.ebuild
index 8c994897df9..3111a305fc4 100644
--- a/sys-fs/lvm2/lvm2-2.02.187-r2.ebuild
+++ b/sys-fs/lvm2/lvm2-2.02.187-r2.ebuild
@@ -271,6 +271,22 @@ pkg_postinst() {
        ewarn
        ewarn "Make sure to enable lvmetad in /etc/lvm/lvm.conf if you want"
        ewarn "to enable lvm autoactivation and metadata caching."
+
+       if use udev && [[ -d /run ]] ; then
+               local permission_run_expected="drwxr-xr-x"
+               local permission_run=$(stat -c "%A" /run)
+               if [[ "${permission_run}" != "${permission_run_expected}" ]] ; 
then
+                       ewarn "Found the following problematic permissions:"
+                       ewarn ""
+                       ewarn "    ${permission_run} /run"
+                       ewarn ""
+                       ewarn "Expected:"
+                       ewarn ""
+                       ewarn "    ${permission_run_expected} /run"
+                       ewarn ""
+                       ewarn "This is known to be causing problems for 
UDEV-enabled LVM services."
+               fi
+       fi
 }
 
 src_test() {

diff --git a/sys-fs/lvm2/lvm2-2.03.10.ebuild b/sys-fs/lvm2/lvm2-2.03.10.ebuild
index 40418f6bae3..66bf4be80bc 100644
--- a/sys-fs/lvm2/lvm2-2.03.10.ebuild
+++ b/sys-fs/lvm2/lvm2-2.03.10.ebuild
@@ -255,6 +255,22 @@ src_install() {
 pkg_postinst() {
        ewarn "Make sure the \"lvm\" init script is in the runlevels:"
        ewarn "# rc-update add lvm boot"
+
+       if use udev && [[ -d /run ]] ; then
+               local permission_run_expected="drwxr-xr-x"
+               local permission_run=$(stat -c "%A" /run)
+               if [[ "${permission_run}" != "${permission_run_expected}" ]] ; 
then
+                       ewarn "Found the following problematic permissions:"
+                       ewarn ""
+                       ewarn "    ${permission_run} /run"
+                       ewarn ""
+                       ewarn "Expected:"
+                       ewarn ""
+                       ewarn "    ${permission_run_expected} /run"
+                       ewarn ""
+                       ewarn "This is known to be causing problems for 
UDEV-enabled LVM services."
+               fi
+       fi
 }
 
 src_test() {

Reply via email to