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

multipathd started leads to initrd blocked. #65

Closed
lixiaokeng opened this issue Mar 25, 2023 · 7 comments · Fixed by #64
Closed

multipathd started leads to initrd blocked. #65

lixiaokeng opened this issue Mar 25, 2023 · 7 comments · Fixed by #64

Comments

@lixiaokeng
Copy link
Contributor

lixiaokeng commented Mar 25, 2023

With 11f0440 commit, we meet a problem.

When there is a multipath device in initrd, multipathd will be actived becasue of dracut/modules.d/90multipath/multipathd-needshutdown.sh running. This lead to initrd-cleanup.service can't be run and switch root fails. The initrd is blocked.

dracutdevs/dracut#2289

@mwilck
Copy link
Contributor

mwilck commented Mar 25, 2023

I think the entire multipathd-needshutdown.sh logic is obsoleted by our queue_without_daemon feature. multipathd itself will take care that queuing is disabled when it quits.

@bmarzins, please double-check, I tend to overlook things lately ...

@mwilck
Copy link
Contributor

mwilck commented Mar 25, 2023

If we still need multipathd-needshutdown.sh and multipathd-shutdown.sh (as noted above, I think we don't),
we should call multipath with the -D option in these files.

@mwilck
Copy link
Contributor

mwilck commented Mar 25, 2023

@lixiaokeng, please try if removing the line

Also=multipathd.socket

in multipathd.service fixes the issue.

mwilck added a commit to openSUSE/multipath-tools that referenced this issue Mar 25, 2023
This "Also=" directive is wrong. It was meant for enabling socket activation,
but it actually does the opposite. "Also=multipathd.socket" means that
enabling/disabling the service will enable/disable the socket, too. This is
not what we want: socket activation means that we can enable the socket
while the service is disabled and will be activated by the socket on demand.

See dracutdevs/dracut#2290,
opensvc#65

Fixes: ca985df ("multipathd: switch to socket activation for systemd")
Signed-off-by: Martin Wilck <[email protected]>
@lixiaokeng
Copy link
Contributor Author

We test this (https://github.com/dracutdevs/dracut/pull/2290/files),and it fix this issue.

@bmarzins
Copy link
Contributor

bmarzins commented Mar 27, 2023

I'm on the fence about the best way to solve this:

  • Removing those dracut scripts cuts down on unnecessary work. But multipathd won't turn off queuing if it terminates abnormally, so I guess these are a backup to make sure that IO to these devices won't hang indefinitely, possibly hanging your system just when it hardest to figure out what's going wrong. I'm not sure if this corner case is enough to justify their existence.
  • Disabling multipath.socket in the initramfs seems really sensible. If we need multipathd running in the initramfs, we should be starting it explicitly. Disabling the socket unit will catch any unintended startups. I doubt that this change will cause any problems. If some setup in some distribution is relying on a socket call to start up multipathd in the initramfs, that seems like their bug.
  • Running the shutdown multipath commands run with -D seems like the right thing to do. But it also seems like we should be doing more.

In the end, I think I vote for doing the last two. Disabling the socket should be enough for the initramfs, but there's no point in multipathd trying to delegate work if we don't want it delegated. As for the first option, I may be letting my systemd shutdown ignorance show, but couldn't this also interfere with actual system shutdown. Accoring to the dracut-shutdown service man page: shutdown will try to umount every /oldroot mount and calls the various shutdown hooks from the dracut modules. If we are currently making certain that we disable queuing when we shut the system down, even if multipathd isn't currently running, then I feel we should probably continue to do so, just out of caution. You can override queue_without_daemon, and it's perfectly reasonable to do so in some cases, like if you are trying to update the multipath-tools binaries. If multipathd failed to restart after this, queuing would be left enabled.

@mwilck
Copy link
Contributor

mwilck commented Mar 27, 2023

My previous comment about -D was premature. I double-checked, and the two dracut scripts in question just run multipath -l, which currently does't attempt to delegate the command, or access the socket. As noted in dracutdevs/dracut#2290 (comment), I don't understand how socket activation occured in the error case. It could have been multipath -u run from udev rules1, maybe, but does that run during shutdown?

You can override queue_without_daemon, and it's perfectly reasonable to do so in some cases, like if you are trying to update the multipath-tools binaries. If multipathd failed to restart after this, queuing would be left enabled.

OK. According to @lixiaokeng's comment above, disabling the socket in the initrd is sufficient to fix the issue. So we can leave the shutdown scripts untouched 2.

Footnotes

  1. which doesn't care about -D

  2. Although one might argue that turning off queue_without_daemon and then shutting down with no paths left is a corner case that qualifies as "shooting oneself in the foot", and deserves having to hit the big red button.

mwilck added a commit to openSUSE/multipath-tools that referenced this issue Mar 28, 2023
This "Also=" directive is wrong. It was meant for enabling socket activation,
but it actually does the opposite. "Also=multipathd.socket" means that
enabling/disabling the service will enable/disable the socket, too. This is
not what we want: socket activation means that we can enable the socket
while the service is disabled and will be activated by the socket on demand.

See dracutdevs/dracut#2290,
opensvc#65

Fixes: ca985df ("multipathd: switch to socket activation for systemd")
Signed-off-by: Martin Wilck <[email protected]>
Reviewed-by: Benjamin Marzinski <[email protected]>
mwilck added a commit to openSUSE/multipath-tools that referenced this issue Mar 28, 2023
This "Also=" directive is wrong. It was meant for enabling socket activation,
but it actually does the opposite. "Also=multipathd.socket" means that
enabling/disabling the service will enable/disable the socket, too. This is
not what we want: socket activation means that we can enable the socket
while the service is disabled and will be activated by the socket on demand.

See dracutdevs/dracut#2290,
opensvc#65

Fixes: ca985df ("multipathd: switch to socket activation for systemd")
Signed-off-by: Martin Wilck <[email protected]>
Reviewed-by: Benjamin Marzinski <[email protected]>
@lixiaokeng
Copy link
Contributor Author

close

bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this issue May 13, 2023
… SR 1086784

https://build.opensuse.org/request/show/1086784
by user mwilck + dimstar_suse
- Update to version 0.9.5+68+suse.d1b6a1c:
  Upstream bugfixes:
  * libmultipath: use directio checker for LIO targets
    (gh#opensvc/multipath-tools#54)
  * multipathd.service: remove "Also=multipathd.socket"
    (gh#opensvc/multipath-tools#65)
  * libmultipathd: Avoid parsing errors due to unsupported designators (forwarded request 1086780 from mwilck)
mwilck added a commit to openSUSE/multipath-tools that referenced this issue Feb 27, 2024
This "Also=" directive is wrong. It was meant for enabling socket activation,
but it actually does the opposite. "Also=multipathd.socket" means that
enabling/disabling the service will enable/disable the socket, too. This is
not what we want: socket activation means that we can enable the socket
while the service is disabled and will be activated by the socket on demand.

See dracutdevs/dracut#2290,
opensvc#65

Fixes: ca985df ("multipathd: switch to socket activation for systemd")
Signed-off-by: Martin Wilck <[email protected]>
Reviewed-by: Benjamin Marzinski <[email protected]>
(cherry picked from commit 53b215e)
mwilck added a commit to openSUSE/multipath-tools that referenced this issue Feb 27, 2024
This "Also=" directive is wrong. It was meant for enabling socket activation,
but it actually does the opposite. "Also=multipathd.socket" means that
enabling/disabling the service will enable/disable the socket, too. This is
not what we want: socket activation means that we can enable the socket
while the service is disabled and will be activated by the socket on demand.

See dracutdevs/dracut#2290,
opensvc#65

Fixes: ca985df ("multipathd: switch to socket activation for systemd")
Signed-off-by: Martin Wilck <[email protected]>
Reviewed-by: Benjamin Marzinski <[email protected]>
(cherry picked from commit 53b215e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants