Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 506514

Summary: sys-fs/lvm2-2.02.103 - /etc/init.d/lvm handles only a single VG at shutdown
Product: Gentoo Linux Reporter: Walter Trautner <wtrautner>
Component: [OLD] Core systemAssignee: Robin Johnson <robbat2>
Status: RESOLVED TEST-REQUEST    
Severity: normal CC: agk
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Walter Trautner 2014-04-02 04:27:40 UTC
The init script of lvm2 won't shutdown all VGs when more than one requested.

The bugfix is really simple, just add --rows to the calling of all VGs.
Since I've written some message to my self in there, this is just a diff, not a patch:

diff --git a/init.d/lvm b/init.d/lvm
index 76d90f3..e1fc485 100755
--- a/init.d/lvm
+++ b/init.d/lvm
@@ -73,7 +73,8 @@ then
        einfo "Shutting down the Logical Volume Manager"


-        VGS=$($lvm_path vgs --config "${config}" -o vg_name --noheadings --nosuffix 2> /dev/null)
+        # vmc: Added --rows to support multiple vgs
+        VGS=$($lvm_path vgs --config "${config}" -o vg_name --noheadings --nosuffix --rows 2> /dev/null)

         if [ "$VGS" ]
         then
Comment 1 Walter Trautner 2014-04-02 04:39:02 UTC
Maybe some explanation.

The init script builds up calls to lvm, seperated by a new line, which indicates a new command.

Do you have more than one VG, they'll come in lines, which breaks the syntax of the lvm command. To handle this, we wan't the VGs in columns, which funny enough provides the --rows parameter .. At the end we hope to get columns by --rows  ..
Comment 2 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2014-04-02 20:58:23 UTC
please retest with lvm2-2.02.105-r2 as the scripts have changed.
Comment 3 Walter Trautner 2014-04-04 21:14:28 UTC
Thanks, lvm2-2.02.105-r2 is working fine with multiple VGs.