commit:     965220269a5b04a2aeb7061d8e69b62156bd9373
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 17 06:17:25 2019 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Wed Apr 17 07:25:37 2019 +0000

sys-fs/lvm2: don't get stuck with root-on-LVM

During system shutdown, init.d/lvm tries to run 'vgchange -a ln' to
close all LVs. It fails with root-on-LVM (or seperate /usr-on-LVM),
because those mountpoints are still in use. As a best-effort, consider
it done after the 'vgchange -a ln' pass. This is similar to localmount's
stop, which does not fail if a filesystem cannot be unmounted.

Package-Manager: Portage-2.3.62, Repoman-2.3.12
Signed-off-by: Robin H. Johnson <robbat2 <AT>>

 sys-fs/lvm2/files/lvm.rc-2.02.183 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sys-fs/lvm2/files/lvm.rc-2.02.183 
index d431fc72138..ce499a6dd21 100644
--- a/sys-fs/lvm2/files/lvm.rc-2.02.183
+++ b/sys-fs/lvm2/files/lvm.rc-2.02.183
@@ -138,7 +138,10 @@ stop() {
                                lvm_commands="${lvm_commands}vgchange --config 
'${config}' --sysinit -a ln ${VGS}\n"
                                # Order of this is important, have to work 
around dash and LVM readline
                                printf "%b\n" "${lvm_commands}" | $lvm_path 
/proc/self/fd/0 --config "${config}" >/dev/null
-                       ${_ending} $? "Failed (possibly some LVs still needed 
for /usr or root)"
+                       rc=$?
+                       msg="Failed (possibly some LVs still needed for /usr or 
+                       [ "$RC_RUNLEVEL" = shutdown ] && msg="${msg} [rc=$rc]" 
&& rc=0
+                       ${_ending} $rc "${msg}"
                einfo "Finished shutting down the Logical Volume Manager"

Reply via email to