Subject: bug#271: [Devuan-bugs] bug#271: same in beowulf, but

From: fsmithred <[email-masked]>
Date: Sun, 24 Feb 2019 11:33:52 -0500

On 02/01/2019 01:02 PM, Where all about bugs in Devuan packages is
reported wrote:
> cryptsetup in beowulf/ceres faces same issue. shutdown takes almost a
> minute to complete. startup takes ~5-10".
> 
> version in beowulf at the moment is 2:2.0.6-1 and a lot of things seem
> changed, but this bug still occurs.

It's still present in 2:2.1.0-1 (currently in ceres/beowulf)
I applied Jan's patch from bug#237 and it seems to be working. (my diff
attached)
https://bugs.devuan.org//cgi/bugreport.cgi?bug=237

Another user tried it and sees a cryptsetup error go by quickly on
shutdown. My shutdown goes by too fast for me to see anything.

> i believe mx package can be found here :
> http://mxrepo.com/mx/repo/pool/main/c/cryptsetup-modified-functions/

Looks like it's for the older version of cryptsetup - it uses
cryptdisk.functions instead of cryptdisk-functions

> 
> also, could this be a eudev issue like in debian?
> ( https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=791944#305 ) and
> fixed in eudev init script like this :
> https://salsa.debian.org/systemd-team/systemd/commit/e803efca59978aa5bb1d8806247f986d0c0f7e67
> , perhaps??
> don't know much about internals, just wandering.

Those fixes are already in eudev in beowulf.

fsmithred

--- /lib/cryptsetup/cryptdisks-functions.orig	2019-02-23 18:47:10.260093106 -0500
+++ /lib/cryptsetup/cryptdisks-functions	2019-02-23 18:49:21.940097241 -0500
@@ -179,7 +179,18 @@
 
 # Removes all mappings in crypttab
 do_stop() {
+
+    local vgs vg
+
     dmsetup mknodes
+    if [ -x /sbin/lvm ]; then
+        vgs="$(/sbin/lvm vgscan | sed -n '/"/s/^.*"\([^'\'']*\)".*$/\1/p')"
+        if [ -n "${vgs}" ]; then
+          for vg in ${vgs}; do
+            /sbin/lvm vgchange -a n ${vg} >/dev/null 2>&1 
+          done 
+        fi
+    fi
     log_action_begin_msg "Stopping $INITSTATE crypto disks"
 
     crypttab_foreach_entry _do_stop_callback