On Sun, 2 Jun 2024 at 23:22, Guilhem Moulin <guil...@debian.org> wrote:
>
> Control: tag -1 = pending
>
> Hi,
>
> On Mon, 27 May 2024 at 23:32:13 +0100, Luca Boccassi wrote:
> > Please consider applying the same change in the initramfs-tools
> > cryptsetup scripts, so that x-initrd.attach is recognized (and no
> > warning is printed), and so that it is added if missing. Thanks.
>
> While testing this it seems adding x-initrd.attach to vda5_crypt causes
> systemd not to try to stop systemd-cryptsetup@vda5_crypt.service on
> shutdown, on this system it still tries and fail to remove the DM device
> holding the root file system (vda5_crypt):
>
>          73s [    6.834893] systemd-shutdown[1]: Syncing filesystems and 
> block devices.
>          73s [    6.837554] systemd-shutdown[1]: Sending SIGTERM to remaining 
> processes...
>          73s [    6.845806] systemd-journald[354]: Received SIGTERM from PID 
> 1 (systemd-shutdow).
>          73s [    6.884585] systemd-shutdown[1]: Sending SIGKILL to remaining 
> processes...
>          73s [    6.889688] systemd-shutdown[1]: Unmounting file systems.
>          73s [    6.890874] (sd-umount)[737]: Unmounting 
> '/run/credentials/systemd-cryptsetup@vda5_crypt.service'.
>          73s [    6.893159] (sd-umount)[738]: Unmounting 
> '/run/credentials/systemd-journald.service'.
>          73s [    6.894974] (sd-remount)[739]: Remounting '/' read-only with 
> options 'errors=remount-ro'.
>          73s [    6.925739] EXT4-fs (dm-0): re-mounted 
> 8effcc46-252e-4197-8f24-79f91fc7d8ad ro. Quota mode: none.
>          73s [    6.927993] systemd-shutdown[1]: All filesystems unmounted.
>          73s [    6.928747] systemd-shutdown[1]: Deactivating swaps.
>          73s [    6.929334] systemd-shutdown[1]: All swaps deactivated.
>          73s [    6.929880] systemd-shutdown[1]: Detaching loop devices.
>          73s [    6.933262] systemd-shutdown[1]: All loop devices detached.
>          73s [    6.934343] systemd-shutdown[1]: Stopping MD devices.
>          73s [    6.935470] systemd-shutdown[1]: All MD devices stopped.
>          73s [    6.936602] systemd-shutdown[1]: Detaching DM devices.
>          73s [    6.938329] systemd-shutdown[1]: Not all DM devices detached, 
> 1 left.
>          73s [    6.939932] systemd-shutdown[1]: Detaching DM devices.
>          73s [    6.941675] systemd-shutdown[1]: Not all DM devices detached, 
> 1 left.
>          73s [    6.943213] systemd-shutdown[1]: Detaching DM devices.
>          73s [    6.944951] systemd-shutdown[1]: Not all DM devices detached, 
> 1 left.
>          73s [    6.946351] systemd-shutdown[1]: Cannot finalize remaining DM 
> devices, continuing.
>          73s [    6.948555] systemd-shutdown[1]: Unable to finalize remaining 
> DM devices, ignoring.
>          73s [    6.950748] systemd-shutdown[1]: Syncing filesystems and 
> block devices.
>          73s [    6.952441] systemd-shutdown[1]: Powering off.
>
> Is that expected?

Yes, the purpose of the option is to leave that device alone, as it
cannot be closed from the host os, as programs will be running from
it.

I gather the initramfs scripts are not calling a deferred close after
mounting the rootfs in the initrd. If you add that, the device should
be automatically cleaned up when the root filesystem is umounted.

Reply via email to