!65 fix the problem that initrd is blocked by multipathd

From: @jiayi0118 
Reviewed-by: @openeuler-basic 
Signed-off-by: @openeuler-basic
This commit is contained in:
openeuler-ci-bot 2023-03-27 02:13:15 +00:00 committed by Gitee
commit a56c40be50
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 49 additions and 1 deletions

View File

@ -0,0 +1,44 @@
From 4b6b72a87f0ee2d8e83209a5ceb9862ccd80c33e Mon Sep 17 00:00:00 2001
From: Tianhao Chai <cth451@gmail.com>
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

View File

@ -9,7 +9,7 @@
Name: dracut Name: dracut
Version: 059 Version: 059
Release: 1 Release: 2
Summary: Initramfs generator using udev 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 Patch5: revert-fix-systemd-networkd-make-systemd-networkd.patch
Patch6: make-network-legacy-instead-of-network-manager-the-network.patch Patch6: make-network-legacy-instead-of-network-manager-the-network.patch
Patch7: bring-back-51-dracut-rescue-postinst.sh.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 Source1: https://www.gnu.org/licenses/lgpl-2.1.txt
Source2: openEuler.conf.example Source2: openEuler.conf.example
@ -519,6 +520,9 @@ rm -f 51-dracut-rescue-postinst.sh
%endif %endif
%changelog %changelog
* Mon Mar 27 2023 Jiayi Chen <chenjiayi22@huawei.com> - 059-2
- fix the problem that initrd is blocked by multipathd
* Sat Jan 28 2023 Jiayi Chen <chenjiayi22@huawei.com> - 059-1 * Sat Jan 28 2023 Jiayi Chen <chenjiayi22@huawei.com> - 059-1
- Update to 059 and fix some bugs in spec - Update to 059 and fix some bugs in spec