Skip to content

fix(crypt): set need_shutdown for LUKS under systemd-cryptsetup#2406

Open
nadzyah wants to merge 1 commit into
dracut-ng:mainfrom
nadzyah:shutdown-failed
Open

fix(crypt): set need_shutdown for LUKS under systemd-cryptsetup#2406
nadzyah wants to merge 1 commit into
dracut-ng:mainfrom
nadzyah:shutdown-failed

Conversation

@nadzyah
Copy link
Copy Markdown
Contributor

@nadzyah nadzyah commented Apr 24, 2026

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

  • I have tested it locally
  • I have reviewed and updated any documentation if relevant
  • I am providing new code and test(s) for it

@nadzyah nadzyah requested a review from a team as a code owner April 24, 2026 19:59
@github-actions github-actions Bot added test Issues related to testing modules Issue tracker for all modules crypt Issues related to the crypt module labels Apr 24, 2026
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
Comment thread test/TEST-26-ENC-RAID-LVM/test.sh
@bdrung
Copy link
Copy Markdown
Member

bdrung commented Apr 30, 2026

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

crypt Issues related to the crypt module modules Issue tracker for all modules test Issues related to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants