[systemd-devel] removing dm-crypt mapping hangs on shutdown
Lennart Poettering
lennart at poettering.net
Tue Jun 19 07:09:04 PDT 2012
On Wed, 13.06.12 10:36, Dave Reisner (d at falconindy.com) wrote:
> > I don't think a simply solution would work here as there are other cases
> > that may trigger the initramfs to enable certain devices (e.g. resume
> > from an encrypted swap partition for example).
>
> Sure, there's already code to parse /proc/self/mountinfo and
> /proc/swaps. I don't know offhand how early this runs, but there's an
> opportunity to do some accounting here and mark already active devices
> as "off limits" for disassembly/unmount on shutdown.
Nope, we shouldn't design our systems that fragile. If some resource is
still needed it should make sure to return EBUSY and refuse destruction.
> Alternatively, rather than using a brute force approach, use something a
> little smarter which involves the holders attribute of any given block
> device in /sys/class/block. You can easily recurse down the chain of
> child devices and disassemble as the stack unwinds. In shell script, it
> looks something like this:
Nope. systemd-shutdown is just the last resort for stuff that hasn't
been shutdown cleanly otherwise. it is supposed to be brute force.
Lennart
--
Lennart Poettering - Red Hat, Inc.
More information about the systemd-devel
mailing list