sys-fs/lvm2: don't get stuck with root-on-LVM
authorRobin H. Johnson <robbat2@gentoo.org>
Wed, 17 Apr 2019 06:17:25 +0000 (23:17 -0700)
committerRobin H. Johnson <robbat2@gentoo.org>
Wed, 17 Apr 2019 07:25:37 +0000 (00:25 -0700)
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@gentoo.org>
sys-fs/lvm2/files/lvm.rc-2.02.183

index d431fc721382d696828803b2b0e2c6bcfa870ce9..ce499a6dd21be8f8c33d384b6990f219c97ffc67 100644 (file)
@@ -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 root)"
+                       [ "$RC_RUNLEVEL" = shutdown ] && msg="${msg} [rc=$rc]" && rc=0
+                       ${_ending} $rc "${msg}"
                fi
 
                einfo "Finished shutting down the Logical Volume Manager"