lvm: start lvm2-lvmetad only if present + support lvm2-lvmpolld
authorMichael Prokop <mika@grml.org>
Tue, 23 Jun 2020 10:43:08 +0000 (12:43 +0200)
committerMichael Prokop <mika@grml.org>
Tue, 23 Jun 2020 11:04:22 +0000 (13:04 +0200)
lvm2-lvmetad is gone since 2.03.01-1 (and its init script
was actually dropped later in 2.03.02-2).

Instead lvmpolld is available since 2.02.122-1.

While at it improve formatting, as startup of lvm2-lvmpolld (and
lvm2-lvmetad if present) displays a message on initial startup which
gets in between the "Searching for logical volumes and enabling them:"
and the display of present LVM devices, which isn't nice. So properly
split them.

Closes: grml/grml-autoconfig#10

autoconfig.functions

index 558472b..883231b 100755 (executable)
@@ -1713,12 +1713,18 @@ config_lvm(){
           fi
           eend 0
           if checkbootparam 'lvm' ; then
           fi
           eend 0
           if checkbootparam 'lvm' ; then
-             einfo "Bootoption LVM found. Searching for logical volumes and enabling them:"
              if $SYSTEMD ; then
              if $SYSTEMD ; then
-               service_wrapper lvm2-lvmetad start
-               vgchange -ay
-               eend $?
+               einfo "Bootoption LVM found, enabling related services."
+               if [ -r /etc/init.d/lvm2-lvmetad ] ; then
+                 service_wrapper lvm2-lvmetad start ; eend $?
+               fi
+               if [ -r /etc/init.d/lvm2-lvmpolld ] ; then
+                 service_wrapper lvm2-lvmpolld start ; eend $?
+               fi
+               einfo "Searching for logical volumes and enabling them:"
+               vgchange -ay ; eend $?
              else
              else
+               einfo "Bootoption LVM found. Searching for logical volumes and enabling them:"
                service_wrapper lvm2 start ; eend $?
              fi
           fi
                service_wrapper lvm2 start ; eend $?
              fi
           fi