Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1366575 - Reboot from hangs when rootfs is on LUKS
Summary: Reboot from hangs when rootfs is on LUKS
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 26
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
Depends On:
Blocks: 1370133
TreeView+ depends on / blocked
Reported: 2016-08-12 11:21 UTC by Michal Sekletar
Modified: 2017-03-16 08:25 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1370133 (view as bug list)
Last Closed: 2017-03-16 08:25:32 UTC

Attachments (Terms of Use)

Description Michal Sekletar 2016-08-12 11:21:12 UTC
Description of problem:
When rootfs is on LUKS we need to deactivate LUKS device during shutdown. To do that we call systemd-cryptsetup detach on the particular device. systemd-cryptsetup will then call crypt_deactivate function from libcryptsetup. This function then deactivates device, but when libcryptsetup notices that udev daemon is still running it executes the code path that uses udev cookies (synchronization mechanism implemented by libdevicemapper based on udev). To figure out whether udev is running it uses udev_queue_get_udev_is_active function from libudev. However this function only checks for presence of udev control AF_UNIX socket. Because system is in emergency mode, udev is not running  anymore and corresponding socket unit was also already stopped. Note that systemd by default doesn't unlink AF_UNIX sockets from the filesystem when socket unit is stopped. udev_queue_get_udev_is_active then returns true because /run/udev/control AF_UNIX socket is still present, but udevd is actually not running. That will then cause hang in libcryptsetup. 

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. install system with encrypted /
2. systemctl isolate
3. sulogin
4. reboot

Actual results:
Reboot hangs

Expected results:
Reboot completes in a timely fashion

Additional info:

Comment 1 Fedora End Of Life 2017-02-28 10:05:26 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.

Comment 2 Michal Sekletar 2017-03-16 08:25:32 UTC
This was fixed while ago by,

Above commit is included in systemd-v233 (F26 and rawhide).

Note You need to log in before you can comment on or make changes to this bug.