Bug#694499: [pkg-cryptsetup-devel] Bug#694499: breaks when used together with cryptsetup

2012-11-30 Thread Steve Langasek
On Wed, Nov 28, 2012 at 04:53:25PM +0100, Jonas Meurer wrote:
 Thanks for the patch, Steve. I applied it to the SVN repository. I
 hope to find time for running some basic tests later and upload the
 package this evening. Unfortunately I'm away for the next week. Do you
 intend to push this change into wheezy? If not, then delaying the
 upload for seven more days should not be a problem, right?

I will update the upstart package in unstable to include the Breaks: against
cryptsetup, so that users don't get trapped by this bug.  That upstart
package is targeted to wheezy.  It's up to the release team whether they
think the cryptsetup change should also go in; it would be nice, but having
upstart be incompatible with cryptsetup for wheezy is an acceptable
limitation.

-- 
Steve Langasek   Give me a lever long enough and a Free OS
Debian Developer   to set it on, and I can move the world.
Ubuntu Developerhttp://www.debian.org/
slanga...@ubuntu.com vor...@debian.org


signature.asc
Description: Digital signature


Bug#694499: [pkg-cryptsetup-devel] Bug#694499: breaks when used together with cryptsetup

2012-11-28 Thread Jonas Meurer
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hello,

Am 27.11.2012 08:51, schrieb Steve Langasek:
 On Tue, Nov 27, 2012 at 01:04:05AM +0100, Jelmer Vernooij wrote:
 (not sure whether this is a bug in the upstart files in
 cryptsetup or upstart)
 
 When using upstart together with cryptsetup, upstart hangs
 waiting for startpar right after boot. I also get an error on the
 console from initctl complaining that DEVNAME is not a valid
 level.
 
 This is a bug in cryptsetup.  The cryptsetup package ships upstart
 jobs under names that match the names of the pre-existing init
 scripts.  The problem is that the upstart jobs and init scripts
 *are not equivalent*.  The upstart job
 /etc/init/cryptdisks-early.conf creates one job instance per crypto
 device.  This means that it does *not* generate the event
 necessary to tell startpar that dependencies on
 /etc/init.d/cryptdisks-early are satisfied, and so startpar, which
 knows about the upstart job, hangs indefinitely waiting for a
 non-instance cryptdisks-early event which will never occur.
 
 I've attached a patch which corrects this, as well as correcting a
 shutdown hang with cryptsetup.  Jonas, could you please apply this
 to cryptsetup in unstable?

Thanks for the patch, Steve. I applied it to the SVN repository. I
hope to find time for running some basic tests later and upload the
package this evening. Unfortunately I'm away for the next week. Do you
intend to push this change into wheezy? If not, then delaying the
upload for seven more days should not be a problem, right?

Kind regards,
 jonas


 N.B., I believe cryptsetup is exempted from the requirement in
 Policy 9.11 to have upstart jobs carry the same name as and
 equivalent functionality to the init script, because this
 integrates with /etc/rcS.d.

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iQIcBAEBAgAGBQJQtjNtAAoJEFJi5/9JEEn+5ngP/0dWJ9oM2rDRp7UmBlqyje+l
TEQGIzt59tVCRd1rFN1mRt3pD56qhBYy8eBMnyIz6Fzm/6eX6iOro3bGKsKtcagK
Ms7QWsfSXbPuvJcAzxx86pzj6Wwx2Tk19isMFY1MWrqV6EB9eP7mV0L2UObPxYlg
x336ayBM0jwh30SiZO/w2eKVNC3aGet+po0fBfGmicjTA5Wl2mZ8a9VvRw86eK6O
rYPfDS9MUz51K+yFqt5alXtYvRXySrUqDqf0G6jQV/zgMTHcwAwfOVCytn+RBb/B
AhNM72BArkbq6UXscNTUXDR6rYyAkINQhe5UfSsJHwduJs6+zmrVXIKf/co/zKOb
qQkEszmz9c2qA0OpR9NrpdKQZSMmoAxFp2M62cSXvd6xOQcGtlLsivIP7i6NlZJR
pWaBOVInV7YpBPoC6lscx35lOvmYMPkSVBr8m4chZq6ARBCNBqvTkR84CyH4kY/Q
xCo5FjFvu3WqNngA+dQJFgW4brjBWdDvyCwz3ThL+WJHC9kfqkOn+SLxbeylz6ks
BUuB1owfpb/ipryy/9icdFxu2R+Afro+L+Ol1PJ0rp9t1KAxI9VwwKtcTRshrKIQ
znLS7Bdq66kjcpaMWbMJQ2u4SfNtzK+A40ZkhAW7cFrwXftMUWQFC06HPOyeAz4w
iECKjmgVnf50UbJWOFpf
=GCCk
-END PGP SIGNATURE-


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#694499: breaks when used together with cryptsetup

2012-11-27 Thread Jelmer Vernooij
On Mon, Nov 26, 2012 at 11:51:16PM -0800, Steve Langasek wrote:
 On Tue, Nov 27, 2012 at 01:04:05AM +0100, Jelmer Vernooij wrote:
  (not sure whether this is a bug in the upstart files in cryptsetup or
  upstart)
 
  When using upstart together with cryptsetup, upstart hangs waiting for
  startpar right after boot. I also get an error on the console
  from initctl complaining that DEVNAME is not a valid level.
 
 This is a bug in cryptsetup.  The cryptsetup package ships upstart jobs
 under names that match the names of the pre-existing init scripts.  The
 problem is that the upstart jobs and init scripts *are not equivalent*.  The
 upstart job /etc/init/cryptdisks-early.conf creates one job instance per
 crypto device.  This means that it does *not* generate the event necessary
 to tell startpar that dependencies on /etc/init.d/cryptdisks-early are
 satisfied, and so startpar, which knows about the upstart job, hangs
 indefinitely waiting for a non-instance cryptdisks-early event which will
 never occur.
 
 I've attached a patch which corrects this, as well as correcting a shutdown
 hang with cryptsetup.  Jonas, could you please apply this to cryptsetup in
 unstable?
That was a prompt fix! Thanks.

FWIW, I can confirm this fixes the issue for me.

Cheers,

Jelmer


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#694499: breaks when used together with cryptsetup

2012-11-27 Thread Steve Langasek
On Tue, Nov 27, 2012 at 02:12:37PM +0100, Jelmer Vernooij wrote:
  I've attached a patch which corrects this, as well as correcting a shutdown
  hang with cryptsetup.  Jonas, could you please apply this to cryptsetup in
  unstable?
 That was a prompt fix! Thanks.

 FWIW, I can confirm this fixes the issue for me.

Thanks for confirming.  I've committed a fix for the upstart package to
declare a Breaks: against earlier versions of cryptsetup, so users won't
have to hit this unwittingly.

-- 
Steve Langasek   Give me a lever long enough and a Free OS
Debian Developer   to set it on, and I can move the world.
Ubuntu Developerhttp://www.debian.org/
slanga...@ubuntu.com vor...@debian.org


signature.asc
Description: Digital signature


Bug#694499: breaks when used together with cryptsetup

2012-11-26 Thread Jelmer Vernooij
Package: upstart
Version: 1.6-2
Severity: normal
File: upstart

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

(not sure whether this is a bug in the upstart files in cryptsetup or
upstart)

When using upstart together with cryptsetup, upstart hangs waiting for
startpar right after boot. I also get an error on the console
from initctl complaining that DEVNAME is not a valid level.

/etc/init/cryptdisks-early.conf uses a variable called DEVNAME, perhaps
that's related?

- -- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.6-trunk-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_IE.UTF-8, LC_CTYPE=en_IE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages upstart depends on:
ii  ifupdown0.7.5
ii  initscripts 2.88dsf-34
ii  libc6   2.16-0experimental1
ii  libdbus-1-3 1.6.8-1
ii  libjson00.10-1.1
ii  libnih-dbus11.0.3-4
ii  libnih1 1.0.3-4
ii  libselinux1 2.1.12-1
ii  libudev0175-7.1
ii  mountall2.44
ii  sysv-rc 2.88dsf-34
ii  sysvinit-utils  2.88dsf-34
ii  udev175-7.1

upstart recommends no packages.

Versions of packages upstart suggests:
ii  bash-completion  1:2.0-1
ii  graphviz 2.26.3-12
ii  python   2.7.3-3

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.12 (GNU/Linux)

iQIcBAEBAgAGBQJQtANaAAoJEACAbyvXKaRX/soP/0uiOaYzL2b+h8ggfsdTGOq8
DA3d4wkhV/JgMHLFSUK0ZK4S2WPFfA1BbyvqR3iaXbkqSGF7E0DAvucbwDZVBGj4
i63R5cDyFhfeThj0mfi64s3y1fV7LdTAKVWcEq7qTo5z/NVCPK3/r2+DyGmNFh6b
AX9gWTpzfLBdxzz36YZLiNgEQDSC3bJPa5W9zlK2xolMZpQ2OPtyimpkoKdXDQGW
PMN923aYwVm4VSslQEzaXS5oKIPBDQVrhMl4sDdPWieC3VRrVDZFfkVRkLu0TdMg
sBUpYWkl+pZFJNF31frE+6r+nuReH+5KEoUhgnGklln2+KI49oCv/S+o5cVfzulK
Zcypqkp0NevFnphmAz/eQ9hHKsadaFZgWLOGXz6qJPjH3XghqsPzoEDWwzK+E4ua
QquPmvolmXFvt/yfLbPiyVLYxRqmETE5ep77M6BnI9m4WkU7OuVm8g7m4XEQ1GnD
06bwgWwURvhZYjDtu/ftHI5usHN9uGjGbkzugKJLPDPRcHWyATrl5G7W+BRRSVNC
KVKKRzBo7RmgjNGhACEr3JZb6CrK+vj9zQVMYjnOkzWBS7LqYuiKcQu0qSBZ1FT0
e88J5Ic3llZY/w3i77+mRSI7sN26hn1VVOckUDVIXoiOsZrOduwyFxrjRRqmYvpz
fRcRAfGmhxwg1bECQ8ak
=OG09
-END PGP SIGNATURE-


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#694499: breaks when used together with cryptsetup

2012-11-26 Thread Steve Langasek
reassign 694499 cryptsetup
severity 694499 important
tags 694499 patch
user ubuntu-de...@lists.ubuntu.com
usertags 694499 ubuntu-patch raring
thanks

On Tue, Nov 27, 2012 at 01:04:05AM +0100, Jelmer Vernooij wrote:
 (not sure whether this is a bug in the upstart files in cryptsetup or
 upstart)

 When using upstart together with cryptsetup, upstart hangs waiting for
 startpar right after boot. I also get an error on the console
 from initctl complaining that DEVNAME is not a valid level.

This is a bug in cryptsetup.  The cryptsetup package ships upstart jobs
under names that match the names of the pre-existing init scripts.  The
problem is that the upstart jobs and init scripts *are not equivalent*.  The
upstart job /etc/init/cryptdisks-early.conf creates one job instance per
crypto device.  This means that it does *not* generate the event necessary
to tell startpar that dependencies on /etc/init.d/cryptdisks-early are
satisfied, and so startpar, which knows about the upstart job, hangs
indefinitely waiting for a non-instance cryptdisks-early event which will
never occur.

I've attached a patch which corrects this, as well as correcting a shutdown
hang with cryptsetup.  Jonas, could you please apply this to cryptsetup in
unstable?

N.B., I believe cryptsetup is exempted from the requirement in Policy 9.11
to have upstart jobs carry the same name as and equivalent functionality
to the init script, because this integrates with /etc/rcS.d.

-- 
Steve Langasek   Give me a lever long enough and a Free OS
Debian Developer   to set it on, and I can move the world.
Ubuntu Developerhttp://www.debian.org/
slanga...@ubuntu.com vor...@debian.org
=== modified file 'debian/changelog'
--- a/debian/changelog	2012-11-07 16:12:25 +
+++ b/debian/changelog	2012-11-27 07:41:30 +
@@ -1,3 +1,15 @@
+cryptsetup (2:1.4.3-4.1) UNRELEASED; urgency=low
+
+  * Non-maintainer upload.
+  * Fix upstart jobs to not cause boot hangs when actually used in
+conjunction with startpar.  Closes: #694499.
+  * In connection with the above, make the cryptdisks-early job explicitly
+wait for 'umountfs' on shutdown just like cryptdisks does; otherwise,
+the teardown of the cryptdisks upstart job may cause the cryptdisks-early
+init script run before we're done unmounting filesystems.
+
+ -- Steve Langasek vor...@debian.org  Mon, 26 Nov 2012 19:26:36 -0800
+
 cryptsetup (2:1.4.3-4) unstable; urgency=medium
 
   * change recommends for busybox to busybox | busybox-static. Thanks to

=== modified file 'debian/cryptdisks-early.init'
--- a/debian/cryptdisks-early.init	2011-05-11 14:45:42 +
+++ b/debian/cryptdisks-early.init	2012-11-27 07:40:19 +
@@ -6,7 +6,7 @@
 # Should-Start:  udev mdadm-raid
 # Should-Stop:   udev mdadm-raid
 # X-Start-Before:lvm2
-# X-Stop-After:  lvm2
+# X-Stop-After:  lvm2 umountfs
 # X-Interactive: true
 # Default-Start: S
 # Default-Stop:  0 6

=== removed file 'debian/cryptdisks-early.upstart'
--- a/debian/cryptdisks-early.upstart	2012-04-11 23:55:35 +
+++ b/debian/cryptdisks-early.upstart	1970-01-01 00:00:00 +
@@ -1,25 +0,0 @@
-# cryptdisks - enable encrypted block devices
-
-descriptionenable encrypted block devices
-
-start on block-device-added ID_FS_USAGE=crypto
-instance $DEVNAME
-
-task
-
-script
-	if [ -r /lib/cryptsetup/cryptdisks.functions ]; then
-		. /lib/cryptsetup/cryptdisks.functions
-	else
-		exit 0
-	fi
-
-	case $CRYPTDISKS_ENABLE in
-	[Nn]*)
-		exit 1
-		;;
-	esac
-
-	INITSTATE=udev
-	crypttab_start_one_disk $DEVNAME
-end script

=== added file 'debian/cryptdisks-udev.upstart'
--- a/debian/cryptdisks-udev.upstart	1970-01-01 00:00:00 +
+++ b/debian/cryptdisks-udev.upstart	2012-11-27 03:21:23 +
@@ -0,0 +1,25 @@
+# cryptdisks - enable encrypted block devices
+
+descriptionenable encrypted block devices
+
+start on block-device-added ID_FS_USAGE=crypto
+instance $DEVNAME
+
+task
+
+script
+	if [ -r /lib/cryptsetup/cryptdisks.functions ]; then
+		. /lib/cryptsetup/cryptdisks.functions
+	else
+		exit 0
+	fi
+
+	case $CRYPTDISKS_ENABLE in
+	[Nn]*)
+		exit 1
+		;;
+	esac
+
+	INITSTATE=udev
+	crypttab_start_one_disk $DEVNAME
+end script

=== modified file 'debian/cryptdisks.upstart'
--- a/debian/cryptdisks.upstart	2012-06-08 13:42:51 +
+++ b/debian/cryptdisks.upstart	2012-11-27 07:07:27 +
@@ -17,9 +17,17 @@
 
 start on stopped udevtrigger or container
 
+# Currently stopping is a no-op, so we can stop this anywhere during the
+# shutdown sequence.  We let the cryptdisks-early init script take care of
+# device teardown instead; it happens that the distinction between the
+# 'cryptdisks' and 'cryptdisks-early' jobs is irrelevant on shutdown because
+# the only sequencing difference is lvm2, which has no init script that's
+# called on shutdown.
+stop on unmounted-remote-filesystems
+
 task
 
-script
+pre-start script
 	if