fix(crypt): set need_shutdown for LUKS under systemd-cryptsetup - #2406
fix(crypt): set need_shutdown for LUKS under systemd-cryptsetup#2406nadzyah wants to merge 1 commit into
Conversation
cryptroot-ask.sh calls need_shutdown() in the legacy path, but systemd-cryptsetup has no equivalent. Without the flag, dracut-initramfs-restore exits early, the initramfs is not pivoted to at shutdown, and dm-shutdown.sh never runs, leaving LUKS stacks busy and blocking poweroff. Add a cleanup hook that sets the flag whenever a LUKS mapping is active, matching the mdraid-needshutdown.sh / multipathd-needshutdown.sh pattern. Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/dracut/+bug/2147476
5a98392 to
cdd2e77
Compare
|
Is this a bug in systemd-shutdown? In other words: should we make this case work with systemd-shutdown and not rely on needing dracut's exitrd? |
|
I think I'm subject to the bug reported on ubuntu. I'm using Ubuntu 25.10 with the root system on LUKS, with As this is very annoying, could I "safely" test this fix on my end? Should I use the hook in this PR and put in under |
|
Hum, while digging a bit deeper to understand what's going on, I noticed that on the unmodified system, I already have a I'm not sure which module is the source of it, could be Does this indicate that the changes in this PR wouldn't really change anything? (since, as far as I can understand, this PR is supposed to call |
|
Hello - I am the original reporter of the Launchpad issue. I recently updated to Ubuntu 26.04 and just now tried the fix in this PR (editing /usr/lib/dracut/modules.d/70crypt/module-setup.sh, running Similar to what @zertin found, on my system (without the fix in this PR) I have the empty file ".need_shutdown" in /run/initramfs. I also believe this was created by lvm_scan.sh. Not sure if these will be helpful (both without changes in this PR):
|
|
@zertrin @jefferyto thank you so much for testing these changes! I really appreciate it! I'll be sure to dive back into this when I find some time later. Thanks again! |
cryptroot-ask.sh calls need_shutdown() in the legacy path, but systemd-cryptsetup has no equivalent. Without the flag, dracut-initramfs-restore exits early, the initramfs is not pivoted to at shutdown, and dm-shutdown.sh never runs, leaving LUKS stacks busy and blocking poweroff.
Add a cleanup hook that sets the flag whenever a LUKS mapping is active, matching the mdraid-needshutdown.sh / multipathd-needshutdown.sh pattern.
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/dracut/+bug/2147476
Checklist