-
Notifications
You must be signed in to change notification settings - Fork 400
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
fix(multipath): enable service but disable socket #2290
fix(multipath): enable service but disable socket #2290
Conversation
See opensvc/multipath-tools#65 I think we should get rid of the entire |
I don't know why #2210 was made because I wasn't involved, and there was no bug report linked. I don't think we should rely on socket activation for multipathd in the initrd. |
Another thing worth trying here would be to run multipath with the |
Absolutely not. The only reason that the socket got involved is due to it declared in The |
Well, as I said above, either multipathd must be running, or socket activation must be enabled, otherwise multipath activation in the initrd will fail. The best idea would be to start multipathd early in the intird. The
Right. It's an undocumented feature :-) . It isn't meant for end users. But it might be useful for dracut. It would not make a difference for |
So dracut enables multipathd.service - fine on its own. Enabling service enables |
Understood. The |
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]>
Just sent a patch to |
What I said about
So it remains unclear to me why the socket is activated. |
This patch works in my system. LGTM |
IIUC, if Martin's patch removing the |
I'd guess that dracut needs to account for older versions of mp-tools. Maybe I should just revert #2010 and remove |
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]>
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]>
It has got positive review and is scheduled to be merged with opensvc/multipath-tools#64 |
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.
Following upstream. My old fix reverted and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
FTR: I had a similar discussion about a different unit recently, shedding some more light on the issue.2
Using |
Thanks for this background explanation Martin, sometimes systemd is too tricky... |
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)
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)
Changes
This fixes a hang in the cleanup hook: running multipath binary triggers activation of
multipathd.service
after it is (and must remain) stopped as dracut prepares to switch root ininitrd-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
frommultipathd.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.Checklist
Fixes #2289, #2175