diff --git a/backport-fix-multipath-enable-service-but-disable-socket.patch b/backport-fix-multipath-remove-dependency-on-multipathd-socket.patch similarity index 35% rename from backport-fix-multipath-enable-service-but-disable-socket.patch rename to backport-fix-multipath-remove-dependency-on-multipathd-socket.patch index 62cdb0faacb8f5973ab6c1b5292cc163b813f424..e8de078e49f7e724ee0e07e06ed6e8fe5c00b7f4 100644 --- a/backport-fix-multipath-enable-service-but-disable-socket.patch +++ b/backport-fix-multipath-remove-dependency-on-multipathd-socket.patch @@ -1,44 +1,44 @@ -From 4b6b72a87f0ee2d8e83209a5ceb9862ccd80c33e Mon Sep 17 00:00:00 2001 +From 71696ec83fce0b20a3cf489b970a200e44227d78 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 +Date: Mon, 10 Apr 2023 20:36:12 -0400 +Subject: [PATCH] fix(multipath): remove dependency on multipathd.socket + +This reverts commit e39ff407eca1d783ab44093c44db5ee401ff5b1d, removes +an incorrect `Also=` directive from multipathd.service. + +`Also=multipathd.socket` is not the correct behavior for a +socket-activated service. This directive has been removed upstream +and dracut should do the same. 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 +Reference:https://github.com/dracutdevs/dracut/pull/2290/commits/71696ec83fce0b20a3cf489b970a200e44227d78 Conflict:NA - --- - modules.d/90multipath/module-setup.sh | 3 +++ - 1 file changed, 3 insertions(+) + modules.d/90multipath/module-setup.sh | 1 - + modules.d/90multipath/multipathd.service | 1 - + 2 files changed, 2 deletions(-) diff --git a/modules.d/90multipath/module-setup.sh b/modules.d/90multipath/module-setup.sh -index 370cab9..707d6b9 100755 +index 370cab92b..9c3e6295f 100755 --- a/modules.d/90multipath/module-setup.sh +++ b/modules.d/90multipath/module-setup.sh -@@ -139,7 +139,10 @@ install() { +@@ -137,7 +137,6 @@ install() { + inst_simple "${moddir}/multipathd-configure.service" "${systemdsystemunitdir}/multipathd-configure.service" + $SYSTEMCTL -q --root "$initdir" enable multipathd-configure.service fi - inst_simple "${systemdsystemunitdir}/multipathd.socket" +- 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/modules.d/90multipath/multipathd.service b/modules.d/90multipath/multipathd.service +index e8182533d..1680cdfb3 100644 +--- a/modules.d/90multipath/multipathd.service ++++ b/modules.d/90multipath/multipathd.service +@@ -25,4 +25,3 @@ TasksMax=infinity + + [Install] + WantedBy=sysinit.target +-Also=multipathd.socket diff --git a/dracut.spec b/dracut.spec index 3495e5bcd40bca086a6f9c0ba25ac0119313c8b0..c8ebd02bf578c626f7047d0466c69f24a39cade0 100644 --- a/dracut.spec +++ b/dracut.spec @@ -9,7 +9,7 @@ Name: dracut Version: 059 -Release: 2 +Release: 3 Summary: Initramfs generator using udev @@ -31,7 +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 +Patch8: backport-fix-multipath-remove-dependency-on-multipathd-socket.patch Source1: https://www.gnu.org/licenses/lgpl-2.1.txt Source2: openEuler.conf.example @@ -520,6 +520,9 @@ rm -f 51-dracut-rescue-postinst.sh %endif %changelog +* Tue Apr 11 2023 Jiayi Chen - 059-3 +- remove dependency on multipathd.socket to fix initrd hanging + * Mon Mar 27 2023 Jiayi Chen - 059-2 - fix the problem that initrd is blocked by multipathd