Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 601998 - sys-fs/lvm2: Runscript shouldn't fail on shutdown
Summary: sys-fs/lvm2: Runscript shouldn't fail on shutdown
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement with 1 vote (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-08 15:17 UTC by Thomas Deutschmann (RETIRED)
Modified: 2018-08-04 22:34 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Even more calm variant. (shutdown-warnings.patch,659 bytes, patch)
2017-01-09 16:03 UTC, Cddr
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Deutschmann (RETIRED) gentoo-dev 2016-12-08 15:17:38 UTC
I have systems with multiple logical volumes on multiple disk. My rootfs is on LVM as well.

On shutdown, the lvm runscript will fail becaue it is unable to close all LVM volumes. That's OK and the message already indicates something like that. But this can be improved:


--- files/lvm.rc-2.02.116-r6    2016-10-29 15:51:00.986911502 +0200
+++ /etc/init.d/lvm     2016-11-02 23:05:23.724452676 +0100
@@ -113,6 +113,8 @@

         if [ "$VGS" ]
         then
+           local _ending="eend"
+           [ "$RC_RUNLEVEL" = shutdown ] && _ending="ewend"
             ebegin "  Shutting Down LVs & VGs"
                        #still echo stderr for debugging
                        lvm_commands="#! ${lvm_path} --config '${config}'\n"
@@ -122,7 +124,7 @@
                        lvm_commands="${lvm_commands}vgchange --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
-                       eend $? "Failed (possibly some LVs still needed for /usr or root)"
+                       ${_ending} $? "Failed (possibly some LVs still needed for /usr or root)"
         fi

        einfo "Finished shutting down the Logical Volume Manager"
Comment 1 Cddr 2017-01-09 16:03:47 UTC
Created attachment 459370 [details, diff]
Even more calm variant.
Comment 2 Larry the Git Cow gentoo-dev 2018-08-04 22:34:47 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7a02982725ea069edf61b5235a91050e4ba8cc91

commit 7a02982725ea069edf61b5235a91050e4ba8cc91
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2018-08-04 22:31:36 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2018-08-04 22:31:36 +0000

    sys-fs/lvm2: use ewend instead of eend on shutdown
    
    Closes: https://bugs.gentoo.org/601998
    Package-Manager: Portage-2.3.44, Repoman-2.3.10

 sys-fs/lvm2/files/lvm.rc-2.02.172 | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)