Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 247966

Summary: sys-fs/cryptsetup: parallel shutdown fails to stop dmcrypt
Product: Gentoo Linux Reporter: crusaderky
Component: [OLD] Core systemAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED OBSOLETE    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description crusaderky 2008-11-21 13:30:54 UTC
I've got
baselayout-2.0.0
openrc-0.3.0-r1
cryptsetup-1.0.6-r2

I've got an encrypted partition mounted in /dmcrypt, and two symlinks on the system:

/home -> /dmcrypt/home
/root -> /dmcrypt/root

With rc_parallel="YES", if I
- logout my normal user
- login as root
- cd /
- manyally stop services, until lsof | grep /dmcrypt returns zero results
- poweroff

I get the message that service dmcrypt can't be stopped since it is in use.

If I disable rc_parallel, everything works fine and the dmcrypt service is stopped correctly.
Comment 1 crusaderky 2008-11-21 14:00:37 UTC
I patched the stop script to gather some intel:

---  /lib/rcscripts/addons/dm-crypt-stop.sh	2008-11-21 14:40:33.000000000 +0100
+++ /lib/rcscripts/addons/dm-crypt-stop.sh	2008-11-21 14:45:17.000000000 +0100
@@ -18,6 +18,7 @@
 		[ -z "${target}" ] && ewarn "Invalid line in /etc/conf.d/dmcrypt: ${targetline}"
 
 		ebegin "Removing dm-crypt mapping for: ${target}"
+		lsof | grep /dmcrypt > /var/log/dmcrypt-fail
 		${csetup} remove ${target}
 		eend $? "Failed to remove dm-crypt mapping for: ${target}"
 	done


After restarting, I got:
$ cat /var/log/dmcrypt-fail 
grep      3984 root    1w      REG                8,2        0 407221 /var/log/dmcrypt-fail

that is, zero processes accessing that partition.
Comment 2 SpanKY gentoo-dev 2016-01-08 03:25:07 UTC
please re-open if it's still an issue