diff --git a/backport-fix-multipath-enable-service-but-disable-socket.patch b/backport-fix-multipath-enable-service-but-disable-socket.patch new file mode 100644 index 0000000000000000000000000000000000000000..005aa2f3f747a4cc9b3371bbfe2cad099f886e78 --- /dev/null +++ b/backport-fix-multipath-enable-service-but-disable-socket.patch @@ -0,0 +1,45 @@ +From 4b6b72a87f0ee2d8e83209a5ceb9862ccd80c33e Mon Sep 17 00:00:00 2001 +From: Tianhao Chai +Date: Sat, 25 Mar 2023 16:58:35 -0400 +Subject: [PATCH] fix(multipath): enable service but disable socket + +This fixes #2289, #2175 where in the cleanup hook running multipath +binary triggers activation of multipathd.service after it is stopped +as dracut prepares to switch root in initrd-cleanup.service. + +An earlier fix from PR #2010 was based on an old systemd behavior where +missing socket will prevent the service from being enabled. This does +not seem to be the case anymore. For completeness, I'm disabling the +socket alone after enabling service. + +At the end of the day we should probably remove `Also=multipathd.socket` +from `multipathd.service` and upsteam this change. The whole point of +having a socket enabled separately from the service is that systemd can +start the service as-needed. Binding enable/disable status together +would not be very sane. + +Reference:https://github.com/dracutdevs/dracut/pull/2290/commits/4b6b72a87f0ee2d8e83209a5ceb9862ccd80c33e +Conflict:NA + +--- + modules.d/90multipath/module-setup.sh | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh +index 370cab9..707d6b9 100755 +--- a/modules.d/90multipath/module-setup.sh ++++ b/modules.d/90multipath/module-setup.sh +@@ -139,7 +139,10 @@ install() { + fi + inst_simple "${systemdsystemunitdir}/multipathd.socket" + inst_simple "${moddir}/multipathd.service" "${systemdsystemunitdir}/multipathd.service" ++ # Enables service and the socket, but... + $SYSTEMCTL -q --root "$initdir" enable multipathd.service ++ # the socket hangs initrd-cleanup (see #2289). ++ $SYSTEMCTL -q --root "$initdir" disable multipathd.socket + else + inst_hook pre-trigger 02 "$moddir/multipathd.sh" + inst_hook cleanup 02 "$moddir/multipathd-stop.sh" +-- +2.33.0 + diff --git a/dracut.spec b/dracut.spec index 3d884aea44d4c9251534324c44fb79543c398309..3495e5bcd40bca086a6f9c0ba25ac0119313c8b0 100644 --- a/dracut.spec +++ b/dracut.spec @@ -9,7 +9,7 @@ Name: dracut Version: 059 -Release: 1 +Release: 2 Summary: Initramfs generator using udev @@ -31,6 +31,7 @@ Patch4: add-option-to-include-file-metadata-in-initramfs.patch Patch5: revert-fix-systemd-networkd-make-systemd-networkd.patch Patch6: make-network-legacy-instead-of-network-manager-the-network.patch Patch7: bring-back-51-dracut-rescue-postinst.sh.patch +Patch8: backport-fix-multipath-enable-service-but-disable-socket.patch Source1: https://www.gnu.org/licenses/lgpl-2.1.txt Source2: openEuler.conf.example @@ -519,6 +520,9 @@ rm -f 51-dracut-rescue-postinst.sh %endif %changelog +* Mon Mar 27 2023 Jiayi Chen - 059-2 +- fix the problem that initrd is blocked by multipathd + * Sat Jan 28 2023 Jiayi Chen - 059-1 - Update to 059 and fix some bugs in spec