Adjust mdadm-raid + lvm2 messages and service handling for usage with systemd
authorMichael Prokop <mika@grml.org>
Fri, 21 Apr 2017 12:10:10 +0000 (14:10 +0200)
committerMichael Prokop <mika@grml.org>
Fri, 21 Apr 2017 12:10:10 +0000 (14:10 +0200)
The mdadm-raid unit is masked under systemd, instead it's necessary
to start mdmonitor.

Also lvm2 is masked and needs to be activated via lvm2-lvmetad instead.

autoconfig.functions

index fa75044..6f774db 100755 (executable)
@@ -1644,7 +1644,11 @@ config_swraid(){
 
        if ! checkbootparam 'swraid' ; then
           eindent
-          einfo "Just run 'Start mdadm-raid' to assemble md arrays or boot using 'swraid' as bootoption for autostart."
+          if $SYSTEMD ; then
+            einfo "Just run 'Start mdmonitor' to assemble md arrays or boot using 'swraid' as bootoption for autostart."
+          else
+            einfo "Just run 'Start mdadm-raid' to assemble md arrays or boot using 'swraid' as bootoption for autostart."
+          fi
           eoutdent
        else
           einfo "Bootoption swraid found. Searching for software RAID arrays:"
@@ -1771,11 +1775,19 @@ config_lvm(){
        if lvdisplay 2>&1 | grep -v 'No volume groups found' >/dev/null 2>&1 ; then
           einfo "You seem to have logical volumes (LVM) on your system."
           eindent
-          einfo "Just run 'Start lvm2' to activate them or boot using 'lvm' as bootoption for autostart."
+          if $SYSTEMD ; then
+            einfo "Just run 'Start lvm2-lvmetad' to activate them or boot using 'lvm' as bootoption for autostart."
+          else
+            einfo "Just run 'Start lvm2' to activate them or boot using 'lvm' as bootoption for autostart."
+          fi
           eend 0
           if checkbootparam 'lvm' ; then
              einfo "Bootoption LVM found. Searching for logical volumes:"
-             service_wrapper lvm2 start ; eend $?
+             if $SYSTEMD ; then
+               service_wrapper lvm2-lvmetad start ; eend $?
+             else
+               service_wrapper lvm2 start ; eend $?
+             fi
           fi
           eoutdent
        fi