From: Robin H. Johnson Date: Wed, 17 Apr 2019 06:17:25 +0000 (-0700) Subject: sys-fs/lvm2: don't get stuck with root-on-LVM X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=965220269a5b04a2aeb7061d8e69b62156bd9373;p=gentoo.git 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 --- diff --git a/sys-fs/lvm2/files/lvm.rc-2.02.183 b/sys-fs/lvm2/files/lvm.rc-2.02.183 index d431fc721382..ce499a6dd21b 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 root)" + [ "$RC_RUNLEVEL" = shutdown ] && msg="${msg} [rc=$rc]" && rc=0 + ${_ending} $rc "${msg}" fi einfo "Finished shutting down the Logical Volume Manager"