[pkg-cryptsetup-devel] Bug#791944: udev: shutdown hangs because of missing swapoff

Guilhem Moulin guilhem at guilhem.org
Sun Jan 10 15:57:43 UTC 2016


I'm able to reproduce the problem in fresh install (automatically installed
VM).  AFAICT this is due to the fact that udev is not longer running at this
point.  I applied the following patch:

--8<---------------------------------------------------------------->8--
--- /lib/cryptsetup/cryptdisks.functions
+++ /lib/cryptsetup/cryptdisks.functions
@@ -7,7 +7,7 @@
 TABFILE=${TABFILE-"/etc/crypttab"}
 CRYPTDISKS_ENABLE="Yes"
 
-#set -x
+set -x
 
 # Sanity check #1
 [ -x /sbin/cryptsetup ] || exit 0
@@ -539,11 +539,17 @@
                fi
        done
       
+       /etc/init.d/udev status
+       dmsetup udevcookies
        if [ "$found" = "yes" ]; then
                cryptsetup luksClose "$dst"
        else
                cryptsetup remove "$dst"
-       fi
+       fi &
+       sleep 1                                        
+       dmsetup udevcookies
+       wait
        return $?
 }
--8<---------------------------------------------------------------->8--

While ‘cryptsetup remove’ is hanging there is indeed a pending udev cookie:

    + /etc/init.d/udev status
    [FAIL] systemd-udevd is not running ... failed!
    + dmsetup udevcookies
    Cookie       Semid      Value      Last semop time           Last change time
    + sleep 1
    + [ no = yes ]
    + cryptsetup remove swap
    + dmsetup udevcookies
    Cookie       Semid      Value      Last semop time           Last change time
    0xd4d6a8f    65536      1          Sun Jan 10 10:49:51 2016  Sun Jan 10 10:49:51 2016
    + wait

Adding ‘/etc/init.d/udev start’ before the ‘cryptsetup remove’ solves
the problem.  Of course this is not a proper fix though, since the rcS
dependencies should ensure the proper dependency instead.

Cheers,
-- 
Guilhem.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-cryptsetup-devel/attachments/20160110/5a0cc026/attachment.sig>


More information about the pkg-cryptsetup-devel mailing list