Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-69805

systemd waits forever on shutdown on a LUKS stop job that is never fired

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • rhel-8.10, rhel-9.5
    • systemd
    • None
    • No
    • Important
    • rhel-sst-cs-plumbers
    • ssg_core_services
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • Red Hat Enterprise Linux
    • None
    • None
    • None
    • None

      The issue occurs on both RHEL8 latest and RHEL9 latest.

      What were you trying to do that didn't work?

      When configuring a LUKS device in /etc/crypttab and configuring a corresponding mount with _netdev option, the reboot hangs forever on the cryptsetup@<luks>.service job to execute, but systemd internally never triggers the execution.

      What is the impact of this issue to you?

      Cannot reboot in a timely manner.

      Please provide the package NVR for which the bug is seen:

      systemd-239-82.el8_10.2
      systemd-252-46.el9_5.2

      How reproducible is this bug?:

      Always

      Steps to reproduce

      1. Add a disk to a QEMU/KVM system that will be used to host an encrypted logical volume
      2. Format the disk
        # vgcreate vg01 /dev/vdb
        # lvcreate -l 100%FREE -n data vg01
        # cryptsetup luksFormat /dev/mapper/vg01-data --force-password
        # cryptsetup luksOpen /dev/mapper/vg01-data data
        # mkdir /data
        
      3. Add the entries to /etc/crypttab and /etc/fstab
        # echo "data	/dev/mapper/vg01-data	none" >> /etc/crypttab
        # echo "/dev/mapper/data	/data			ext4	defaults,_netdev	0 0" >> /etc/fstab
        
      4. Reboot, decrypt the LUKS, then initiate a shutdown

      Expected results

      Flawless reboot occurring

      Actual results

      systemd does nothing but wait for stop job:

      ...
      [  OK  ] Unmounted /data.
      [  OK  ] Stopped target Block Device Preparation for /dev/mapper/data.
      [  OK  ] Stopped System Logging Service.
      [  OK  ] Stopped Restore /run/initramfs on shutdown.
      [     *] A stop job is running for /dev/mapper/data (4s / no limit)
      

      After resetting the system, the journal confims that systemd-cryptsetup@data.service/stop was never spawned:

      # grep "Cryptography Setup" j
      Dec 03 11:16:12 vm-luks9-data systemd[1]: Starting Cryptography Setup for data...
      Dec 03 11:16:16 vm-luks9-data systemd[1]: Finished Cryptography Setup for data.
      --> no "Stopping Cryptography Setup for data"
      

              msekleta@redhat.com Michal Sekletar
              rhn-support-rmetrich Renaud Métrich
              systemd maint mailing list systemd maint mailing list
              Frantisek Sumsal Frantisek Sumsal
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: