Skip to content

Commit 0543ebd

Browse files
committed
core: device: device_coldplug(): don't set DEVICE_DEAD
dm-crypt device units generated by systemd-cryptsetup-generator habe BindsTo= dependencies on their backend devices. The dm-crypt devices have the db_persist flag set, and thus survive the udev db cleanup while switching root. But backend devices usually don't survive. These devices are neither mounted nor used for swap, thus they will seen as DEVICE_NOT_FOUND after switching root. The BindsTo dependency will cause systemd to schedule a stop job for the dm-crypt device, breaking boot: [ 68.929457] krypton systemd[1]: systemd-cryptsetup@cr_root.service: Unit is stopped because bound to inactive unit dev-disk-by\x2duuid-3bf91f73\x2d1ee8\x2d4cfc\x2d9048\x2d93ba349b786d.device. [ 68.945660] krypton systemd[1]: systemd-cryptsetup@cr_root.service: Trying to enqueue job systemd-cryptsetup@cr_root.service/stop/replace [ 69.473459] krypton systemd[1]: systemd-cryptsetup@cr_root.service: Installed new job systemd-cryptsetup@cr_root.service/stop as 343 Avoid this by not setting the state of the backend devices to DEVICE_DEAD.
1 parent 2659b04 commit 0543ebd

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

src/core/device.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,6 @@ static int device_coldplug(Unit *u) {
206206
found &= ~DEVICE_FOUND_UDEV; /* ignore DEVICE_FOUND_UDEV bit */
207207
if (state == DEVICE_PLUGGED)
208208
state = DEVICE_TENTATIVE; /* downgrade state */
209-
if (found == DEVICE_NOT_FOUND)
210-
state = DEVICE_DEAD; /* If nobody sees the device, downgrade more */
211209
}
212210

213211
if (d->found == found && d->state == state)

0 commit comments

Comments
 (0)