On Mon, 3 Jun 2024 at 00:09, Guilhem Moulin <guil...@debian.org> wrote: > > On Sun, 02 Jun 2024 at 23:35:57 +0100, Luca Boccassi wrote: > > 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. > > It doesn't leave the device alone though as it still tries to detach it.
Yes it will do some attempts in the shutdown binary, the purpose of the option is to leave it alone in the transition before (when the service is stopped) > > 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. > > initramfs-tools doesn't take the system back on shutdown, so there is > nothing src:cryptsetup can do here. The deferred close is given on the initrd though, immediately after mounting, which I think is done by the cryptsetup initramfs hook? Deferred close means that it will be closed by the kernel once the last mount is gone. So if you call that from the initramfs hook, things should work out automatically on shutdown.