[pkg-cryptsetup-devel] Bug#791944: /etc/init.d/sendsigs kills systemd-udevd upon shutdown, causing dmsetup to hang

Guilhem Moulin guilhem at guilhem.org
Thu Jan 21 17:41:19 UTC 2016


Control: retitle  -1 /etc/init.d/sendsigs kills systemd-udevd upon shutdown, causing dmsetup to hang
Control: reassign -1 initscripts 2.88dsf-59.3
Control: tag      -1 - help moreinfo

On Sun, 10 Jan 2016 at 21:43:36 +0100, Guilhem Moulin wrote:
> On Sun, 10 Jan 2016 at 16:57:43 +0100, Guilhem Moulin wrote:
>> 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:
>> […]
>> 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.
> 
> In fact the dependency chain looks fine already: both the ‘cryptdisks-early’
> and ‘cryptdisks’ scripts have had a “Should-Stop: udev” header since
> 2006.
> 
> How come systemd-udevd does not honor the dependency?  Unfortunately
> this is hard to debug since it happens after the syslog daemon is
> brought down.  CC'ing the systemd maintainers for input (I don't know
> which package is the culprit, but it's odd that the service dies before
> its sysvinit reverse dependencies).

Ah, there: in fact udev is killed by /etc/init.d/sendsigs.  Indeed
applying the following patch

-8<---------------------------------------------------------------------->8-
--- a/etc/init.d/sendsigs
+++ b/etc/init.d/sendsigs
@@ -115,7 +115,9 @@
 	exit 3
 	;;
   stop)
+	/etc/init.d/udev status || true
 	do_stop
+	/etc/init.d/udev status || true
 	;;
   *)
 	echo "Usage: $0 start|stop" >&2
-8<---------------------------------------------------------------------->8-

yields this output

    [ ok ] systemd-udevd is running.
    [ ok ] Asking all remaining processes to terminate...done.
    [ ok ] All processes ended within 1 seconds...done.
    [FAIL] systemd-udevd is not running ... failed!

systemd-udevd should stay alive until its init script tells it to stop.
Killing it earlier causes dmsetup to hang, which in turn freezes the
shutdown when there are open dm devices (such as encrypted disks).

There is a similar looking code in /etc/init.d/killprocs.  But as shown
above it's sendsigs which kills udev here.  Reassigning the bug
accordingly.

Cheers,
-- 
Guilhem.

[0] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=791944#72
-------------- 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/20160121/bf263146/attachment.sig>


More information about the pkg-cryptsetup-devel mailing list