[pkg-cryptsetup-devel] Bug#1006802: cryptdisks_stop should process crtypttab entries in reverse order
Guenther Brunthaler
gbrun at gmx.at
Sat Mar 5 15:54:07 GMT 2022
Am Sat, 5 Mar 2022 13:32:24 +0100
schrieb Guilhem Moulin <guilhem at debian.org>:
> I believe cryptdisks_start(8) and cryptdisks_stop(8) processes
> mappings in the order given on the command line, which is
> intentional. Are you talking about SysV init scripts?
Yes, you are right. The problem actually refers
to "/etc/init.d/cryptdisks".
Or to be more precise, to the do_stop() function called from
there.
That function is defined in line 180 of
/lib/cryptsetup/cryptdisks-functions and the problem is in line 188
which calls
crypttab_foreach_entry _do_stop_callback
which is exactly the same as do_start() does. And hence the entries are
processed in the same order instead of the reverse order, which then
leads to the problem.
The problem kicks in when I want to shut down the Linux box with the
encrypted swap which has been set up by the "start" action of the
service script.
When called again with the "stop" action as part of the shutdown
sequence, the problem happens and the script hangs for a long while
because of the "busy"-problem until giving up and shutting down anyway.
More information about the pkg-cryptsetup-devel
mailing list