Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initrd is blocked because of conflict between multipathd.service and initrd-cleanup.service #2289

Closed
jiayi0118 opened this issue Mar 25, 2023 · 4 comments · Fixed by #2290
Closed
Labels
bug Our bugs multipath Issues related to the multipath module

Comments

@jiayi0118
Copy link

jiayi0118 commented Mar 25, 2023

Describe the bug
initrd is blocked after Finished dracut pre-pivot and cleanup hook and initrd-cleanup.service is not activated.

image

Distribution used
openEuler

Dracut version
059

Init system
systemd

To Reproduce
Install multipath-tools in the system, and use dracut --no-hostonly to generate the initramfs. And there should be at least a multipath disk in the system.

Expected behavior
initrd-cleanup.service should be activated and dracut continues switching root

Additional context
In previous commit 02e646f, multipathd.socket is injected into initramfs when multipath module is added. And in the hook script multipathd-needshutdown.sh in cleanup, multipath -l -v1 is called. If there is a multipath block discovered, multipathd.service will be activated by multipathd.socket. However, multipathd.service is configured to be before and be conflict with initrd-cleanup.service, which results in initrd-cleanup.service can not be activated and initrd is blocked.

@jiayi0118 jiayi0118 added the bug Our bugs label Mar 25, 2023
@LaszloGombos LaszloGombos added the multipath Issues related to the multipath module label Mar 25, 2023
@LaszloGombos
Copy link
Collaborator

LaszloGombos commented Mar 25, 2023

CC @cthbleachbit

Related - #2175

@cthbleachbit
Copy link
Contributor

I was sure that systemd won't even try to activate the socket at boot at the time before I checked in #2010 but I'm not so sure now and I no longer have access to that physical machine that boots from a multipath device...

Let me repeat the experiment in a VM. If this breaks latest installations somehow in the worst case feel free to revert #2010.

@cthbleachbit
Copy link
Contributor

Current observations:

  • (New behavior?) "enabling" a service will automatically enables whatever it has specified in a Also= directive. This implies that multipath.socket gets enabled in the initrd.
  • dracut sets up the correct mp block device and kills multipathd (effectively stopping the service) but does not stop the socket.
  • dracut multipath clean up will call multipath binary which in turn queries multipathd on the socket path, causing systemd to bring up multipathd.service again post-mortem. At this point initrd-cleanup gets blocked.

I can think of two way out:

  • Right now I'm no longer seeing systemd whining about missing auxillary units during initrd build - so I assume we can safely skip multipathd.socket for installation. Revert 90multipath: install multipathd.socket #2010 would do.
  • Or, explicitly disable multipathd.socket after enabling multipathd.service.

For OP if you need a workaround right now:

  • At bootloader specify rd.break=cmdline. This drops you in the emergency shell.
  • Check whether multipathd.socket is enabled and running - if it is running, stop the socket.
  • Exit the shell and it should boot up fine.

@jiayi0118
Copy link
Author

I can think of two way out:

  • Right now I'm no longer seeing systemd whining about missing auxillary units during initrd build - so I assume we can safely skip multipathd.socket for installation. Revert 90multipath: install multipathd.socket #2010 would do.
  • Or, explicitly disable multipathd.socket after enabling multipathd.service.

Both ways can deal with this problem.

aafeijoo-suse pushed a commit that referenced this issue Apr 11, 2023
This reverts commit e39ff40, 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.
aafeijoo-suse pushed a commit to aafeijoo-suse/dracut that referenced this issue Jun 15, 2023
This reverts commit e39ff40, 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 dracutdevs#2289, dracutdevs#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.

(cherry picked from commit 297525c)
pvalena pushed a commit to pvalena/dracut that referenced this issue Jul 23, 2023
This reverts commit e39ff40, 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 dracutdevs#2289, dracutdevs#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.
imguoguo pushed a commit to fedora-riscv/dracut that referenced this issue May 30, 2024
imguoguo pushed a commit to fedora-riscv/dracut that referenced this issue May 30, 2024
imguoguo pushed a commit to fedora-riscv/dracut that referenced this issue May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Our bugs multipath Issues related to the multipath module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants