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