Devuan bug report logs - #483
eudev: eudev sometimes fails to generate initial hotplug events

version graph

Package: eudev; Maintainer for eudev is Devuan Dev Team <devuan-dev@lists.dyne.org>;

Reported by: David Kuehling <dvdkhlng@posteo.de>

Date: Mon, 15 Jun 2020 15:18:02 UTC

Severity: normal

Found in version 3.2.7-6

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to devuan-bugs@lists.dyne.org, dvdkhlng@posteo.de, Devuan Dev Team <devuan-dev@lists.dyne.org>:
bug#483; Package eudev. (Mon, 15 Jun 2020 15:18:02 GMT) (full text, mbox, link).


Acknowledgement sent to David Kuehling <dvdkhlng@posteo.de>:
New bug report received and forwarded. Copy sent to dvdkhlng@posteo.de, Devuan Dev Team <devuan-dev@lists.dyne.org>. (Mon, 15 Jun 2020 15:18:05 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.devuan.org (full text, mbox, reply):

From: David Kuehling <dvdkhlng@posteo.de>
To: Devuan Bug Tracking System <submit@bugs.devuan.org>
Subject: eudev: eudev sometimes fails to generate initial hotplug events
Date: Mon, 15 Jun 2020 17:08:38 +0200
Package: eudev
Version: 3.2.7-6
Severity: normal
File: /etc/init.d/eudev

Dear Maintainer,

eudev sometimes fails to generate the initial hotplug events for one of
my systems.  The symptoms are that many required kernel modules are
missing after boot (no sound, no 3-D acceleration).

The error is not determinstic.  Sometimes the system boots up
successfully and everything works.  Sometimes the system boots up and
essential kernel modules are missing.

Doing '/etc/init.d/eudev stop' followed by '/etc/init.d/eudev start'
corrects the issue (i.e. results in all modules being loaded).  The
issue can also be corrected by manually running 'udevadm trigger
--action=add'.

The actual root cause seems to be a race condition in the
/etc/init.d/eudev startup script: The script first starts eudev via
start-stop-daemon, then calls 'udevadm trigger --action=add'.

On the system in question, after modifying the script, adding 'sleep 1s'
after start-stop-daemon, the startup now succeeded all the (two) times I
tried.

Note that the system in question runs from a root partition that resides
on a NBD-devices, so startup times of eudev may be very different from a
normal HDD-based system, thereby amplifying the likelhood of the race.

I have no clear idea how a proper fix for that race would look like.
Clearly 'start-stop-daemon --background' does NOT wait for the daemon to
be operational and looks like the wrong approach.  Maybe running
start-stop-daemon without "--background" and depending on eudev's
"--daemon" option is better?  Does eudev support using
start-stop-daemon's --notify-await command?  Should we run 'udevadm
trigger' in a loop until it succeeds?


-- System Information:
Distributor ID:	Debian
Description:	Devuan GNU/Linux 3 (beowulf)
Release:	3
Codename:	beowulf
Architecture: x86_64

Kernel: Linux 4.19.0-9-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
LSM: AppArmor: enabled

Versions of packages eudev depends on:
ii  adduser      3.118
ii  debconf      1.5.71
ii  libblkid1    2.33.1-0.1+devuan1~beowulf2
ii  libc6        2.28-10
ii  libeudev1    3.2.7-6
ii  libkmod2     26-1
ii  libselinux1  2.8-1+b1
ii  lsb-base     10.2019051400
ii  procps       2:3.3.15-2+devuan1
ii  util-linux   2.33.1-0.1+devuan1~beowulf2

eudev recommends no packages.

eudev suggests no packages.

-- no debconf information


Information forwarded to devuan-bugs@lists.dyne.org, Devuan Dev Team <devuan-dev@lists.dyne.org>:
bug#483; Package eudev. (Mon, 15 Jun 2020 20:18:01 GMT) (full text, mbox, link).


Acknowledgement sent to fsmithred <fsmithred@gmail.com>:
Extra info received and forwarded to list. Copy sent to Devuan Dev Team <devuan-dev@lists.dyne.org>. (Mon, 15 Jun 2020 20:18:03 GMT) (full text, mbox, link).


Message #10 received at 483@bugs.devuan.org (full text, mbox, reply):

From: fsmithred <fsmithred@gmail.com>
To: 483@bugs.devuan.org
Subject: eudev: eudev sometimes fails to generate initial hotplug events
Date: Mon, 15 Jun 2020 16:00:29 -0400
[Message part 1 (text/plain, inline)]
On 6/15/20 12:15 PM, David Kuehling wrote:
>
> This is my diff:
>
> --- /etc/init.d/eudev	2019-02-09 13:22:24.000000000 +0100
> +++ /tmp/eudev	2020-06-15 17:59:00.384481497 +0200
> @@ -210,6 +210,7 @@
>  	sleep 15
>      fi
>
> +    sleep 1s
>      log_action_begin_msg "Synthesizing the initial hotplug events"
>      if udevadm trigger --action=add; then
>  	log_action_end_msg $?


This fixes a problem I'm having with live-isos booted from optical media.
It boots, but many kernel modules are missing. I used a 10-second sleep to
test, and it works.

For live-isos, the workaround I used was to stop and start eudev in
/etc/rc.local. Here's discussion about that:
https://dev1galaxy.org/viewtopic.php?pid=22137#p22137

fsmithred
[0xA73823D3094C5620.asc (application/pgp-keys, attachment)]

Information forwarded to devuan-bugs@lists.dyne.org, Devuan Dev Team <devuan-dev@lists.dyne.org>:
bug#483; Package eudev. (Wed, 17 Jun 2020 22:33:02 GMT) (full text, mbox, link).


Acknowledgement sent to fsmithred <fsmithred@gmail.com>:
Extra info received and forwarded to list. Copy sent to Devuan Dev Team <devuan-dev@lists.dyne.org>. (Wed, 17 Jun 2020 22:33:04 GMT) (full text, mbox, link).


Message #15 received at 483@bugs.devuan.org (full text, mbox, reply):

From: fsmithred <fsmithred@gmail.com>
To: 483@bugs.devuan.org
Subject: Re: bug#483: eudev: eudev sometimes fails to generate initial hotplug events
Date: Wed, 17 Jun 2020 18:22:27 -0400
[Message part 1 (text/plain, inline)]
I tested with shorter sleep times. One second is enough when booting from dvd.

fsmithred
[0xA73823D3094C5620.asc (application/pgp-keys, attachment)]

Information forwarded to devuan-bugs@lists.dyne.org, Devuan Dev Team <devuan-dev@lists.dyne.org>:
bug#483; Package eudev. (Mon, 13 Jul 2020 18:33:01 GMT) (full text, mbox, link).


Acknowledgement sent to svante.signell@gmail.com:
Extra info received and forwarded to list. Copy sent to Devuan Dev Team <devuan-dev@lists.dyne.org>. (Mon, 13 Jul 2020 18:33:08 GMT) (full text, mbox, link).


Message #20 received at 483@bugs.devuan.org (full text, mbox, reply):

From: Svante Signell <svante.signell@gmail.com>
To: David Kuehling <dvdkhlng@posteo.de>, fsmithred <fsmithred@gmail.com>
Cc: 483@bugs.devuan.org
Subject: eudev: eudev sometimes fails to generate initial hotplug events
Date: Mon, 13 Jul 2020 20:16:42 +0200
[Message part 1 (text/plain, inline)]
Hello,

regarding bug #483, can you try to insert the sleep 1 at the following
place, see the attached patch: eudev.init.diff.

This should apply to eudev-3.2.7-6. Since we plan to include 3.2.9-
7~beowulf1 in beowulf-proposed-updates can you please also test that
patch on eudev.init for that version. It is available from the unstable
release. Don't bother about spacing/tab changes. 

Thanks you very much for your help!

[eudev.init.diff (text/x-patch, attachment)]

Information forwarded to devuan-bugs@lists.dyne.org, Devuan Dev Team <devuan-dev@lists.dyne.org>:
bug#483; Package eudev. (Mon, 13 Jul 2020 21:33:02 GMT) (full text, mbox, link).


Acknowledgement sent to fsmithred <fsmithred@gmail.com>:
Extra info received and forwarded to list. Copy sent to Devuan Dev Team <devuan-dev@lists.dyne.org>. (Mon, 13 Jul 2020 21:33:09 GMT) (full text, mbox, link).


Message #25 received at 483@bugs.devuan.org (full text, mbox, reply):

From: fsmithred <fsmithred@gmail.com>
To: svante.signell@gmail.com, David Kuehling <dvdkhlng@posteo.de>
Cc: 483@bugs.devuan.org
Subject: Re: eudev: eudev sometimes fails to generate initial hotplug events
Date: Mon, 13 Jul 2020 17:06:59 -0400
[Message part 1 (text/plain, inline)]
I tested the fix with 3.2.9-7 that I pulled from ceres and installed in
beowulf. Made a new live-iso, burned it to DVD and it loads all modules on
boot as it should. Looks good here.

fsmithred
[0xA73823D3094C5620.asc (application/pgp-keys, attachment)]

Information forwarded to devuan-bugs@lists.dyne.org, Devuan Dev Team <devuan-dev@lists.dyne.org>:
bug#483; Package eudev. (Wed, 15 Jul 2020 00:33:02 GMT) (full text, mbox, link).


Acknowledgement sent to Trek <trek00@inbox.ru>:
Extra info received and forwarded to list. Copy sent to Devuan Dev Team <devuan-dev@lists.dyne.org>. (Wed, 15 Jul 2020 00:33:09 GMT) (full text, mbox, link).


Message #30 received at 483@bugs.devuan.org (full text, mbox, reply):

From: Trek <trek00@inbox.ru>
To: 483@bugs.devuan.org
Subject: Re: [devuan-dev] bug#483: eudev: eudev sometimes fails to generate initial hotplug events
Date: Wed, 15 Jul 2020 02:20:31 +0200
adding sleep 1 is unreliable (it really depends how fast/slow is the
hardware) as you can see in debian bug #908796

the fix was to add --notify-await to start-stop-daemon without any
additional sleep

if eudev does not implement the notify protocol, then i think it should
be started with --daemon paramenter, but this could bring back the
debian bug #791944, in case eudev does not remove the control socket on
stop or if it does not creates a pidfile

in that case a new init.d script should be written to remove the control
socket just after sendsigs, in order to fix the device-mapper/cryptsetup
shutdown issue

you can see more proposed fixes/workarounds in the bugs linked, but i
give some can help if needed

ciao!

Information forwarded to devuan-bugs@lists.dyne.org, Devuan Dev Team <devuan-dev@lists.dyne.org>:
bug#483; Package eudev. (Tue, 11 Aug 2020 15:33:02 GMT) (full text, mbox, link).


Acknowledgement sent to Trek <trek00@inbox.ru>:
Extra info received and forwarded to list. Copy sent to Devuan Dev Team <devuan-dev@lists.dyne.org>. (Tue, 11 Aug 2020 15:33:11 GMT) (full text, mbox, link).


Message #35 received at 483@bugs.devuan.org (full text, mbox, reply):

From: Trek <trek00@inbox.ru>
To: 483@bugs.devuan.org
Subject: Re: [devuan-dev] bug#483: eudev: eudev sometimes fails to generate initial hotplug events
Date: Tue, 11 Aug 2020 17:24:22 +0200
[Message part 1 (text/plain, inline)]
I had some time to check the sources of eudev and it does not contains
the f59118e commit, that prevented the removal of the control socket on
exit[1], so I send this patch to restore the old rock solid start-up
behavior of udev

the patch is based on the Devuan unstable ed8c5770e0 commit, but please
note that it is untested, as i don't have a Devuan system, nor eudev,
but at least it shows how to do it

basically eudev is launched with --daemon argument and all the pidfile
tracking stuff is removed, because when eudev is killed by sendsigs, it
removes the control socket and dmsetup/cryptsetup will not hang trying
to connect to eudev on shutdown

ciao!

1. https://github.com/systemd/systemd/issues/2477#issuecomment-239077407
[eudev-daemon.patch (text/x-patch, attachment)]

Information forwarded to devuan-bugs@lists.dyne.org, Devuan Dev Team <devuan-dev@lists.dyne.org>:
bug#483; Package eudev. (Wed, 12 Aug 2020 19:18:01 GMT) (full text, mbox, link).


Acknowledgement sent to Trek <trek00@inbox.ru>:
Extra info received and forwarded to list. Copy sent to Devuan Dev Team <devuan-dev@lists.dyne.org>. (Wed, 12 Aug 2020 19:18:04 GMT) (full text, mbox, link).


Message #40 received at 483@bugs.devuan.org (full text, mbox, reply):

From: Trek <trek00@inbox.ru>
To: 483@bugs.devuan.org
Subject: Re: [devuan-dev] bug#483: eudev: eudev sometimes fails to generate initial hotplug events
Date: Wed, 12 Aug 2020 21:01:58 +0200
[Message part 1 (text/plain, inline)]
sorry to write again, but my previous patch could work only if the
interpreter is set to /bin/sh without the -e option

if you don't want to remove the -e option, then this patch should
applied instead

ciao!
[eudev-daemon-e.patch (text/x-patch, attachment)]

Send a report that this bug log contains spam.


Devuan BTS -- Powered by Debian bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson,
2005-2017 Don Armstrong, and many other contributors.

Devuan Bugs Owner <owner@bugs.devuan.org>.
Last modified: Tue Oct 20 14:44:32 2020;