]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
refactor(multipath): remove custom multipathd.service
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Mon, 3 Mar 2025 14:23:41 +0000 (15:23 +0100)
committerNeal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
Sun, 13 Apr 2025 01:39:16 +0000 (21:39 -0400)
Install `multipathd.service` provided by upstream, and add a dropin to support
`rd.multipath=0`.

modules.d/90multipath/module-setup.sh
modules.d/90multipath/multipathd-dracut.conf [new file with mode: 0644]
modules.d/90multipath/multipathd.service [deleted file]

index a05df01839c02769e66458e5f06a6e076d755100..5a7f91fa9c749b507e7243de70b00992704aa772 100755 (executable)
@@ -91,6 +91,7 @@ install() {
     [[ -d $config_dir ]] || config_dir=/etc/multipath/conf.d
 
     inst_multiple \
+        "$systemdsystemunitdir"/multipathd.service \
         pkill \
         kpartx \
         dmsetup \
@@ -151,7 +152,7 @@ EOF
             inst_simple "${moddir}/multipathd-configure.service" "${systemdsystemunitdir}/multipathd-configure.service"
             $SYSTEMCTL -q --root "$initdir" enable multipathd-configure.service
         fi
-        inst_simple "${moddir}/multipathd.service" "${systemdsystemunitdir}/multipathd.service"
+        inst_simple "$moddir/multipathd-dracut.conf" "$systemdsystemunitdir/multipathd.service.d/multipathd-dracut.conf"
         $SYSTEMCTL -q --root "$initdir" enable multipathd.service
     else
         inst_hook pre-trigger 02 "$moddir/multipathd.sh"
diff --git a/modules.d/90multipath/multipathd-dracut.conf b/modules.d/90multipath/multipathd-dracut.conf
new file mode 100644 (file)
index 0000000..783b05d
--- /dev/null
@@ -0,0 +1,2 @@
+[Unit]
+ConditionKernelCommandLine=!rd.multipath=0
diff --git a/modules.d/90multipath/multipathd.service b/modules.d/90multipath/multipathd.service
deleted file mode 100644 (file)
index 3248fa9..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-[Unit]
-Description=Device-Mapper Multipath Device Controller
-Before=lvm2-activation-early.service
-Before=local-fs-pre.target blk-availability.service shutdown.target
-Wants=systemd-udevd-kernel.socket
-After=systemd-udevd-kernel.socket
-After=multipathd.socket systemd-remount-fs.service
-Before=initrd-cleanup.service
-DefaultDependencies=no
-Conflicts=shutdown.target
-Conflicts=initrd-cleanup.service
-ConditionKernelCommandLine=!nompath
-ConditionKernelCommandLine=!rd.multipath=0
-ConditionKernelCommandLine=!multipath=off
-ConditionVirtualization=!container
-
-[Service]
-Type=notify
-NotifyAccess=main
-ExecStartPre=-/sbin/modprobe dm-multipath
-ExecStart=/sbin/multipathd -d -s
-ExecReload=/sbin/multipathd reconfigure
-TasksMax=infinity
-
-[Install]
-WantedBy=sysinit.target