The mysterious behaviour of udevd
I have been posting about freezing at bootup, for 2-3 minutes. This is due to udevd, the udev daemon, and it has been a struggle. I changed the commandline in /etc/rc.d/rc.sysinit:
udevd --daemon --resolve-names=never --children-max=64 --debug --event-timeout=20 >/tmp/udevd-debug.log 2>&1
The default children maximum was only 16, which is also very odd, as it is supposed to be according to a formula "8 + (number of cpus)*64", which I saw in online reading.
The default timeout is 180 seconds. Increasing the number of children helped. Also now bootup will "only" freeze for 20 seconds.
examining the log at /tmp/udevd-debug.log, it can be seen where there is "timeout", which is a process called via a udev rule taking too long, that is 20 seconds. And that is also very odd, as I am getting processes such as this timing out:
ACTION=="add", SUBSYSTEM=="bluetooth", RUN+="/usr/local/pup_event/bluetooth-add"
...that 'bluetooth-add' script is tiny, will complete execution in microseconds. Which makes the behaviour of udevd extremely puzzling.
Forum member don570 posted something yesterday, that is also mysterious:
https://forum.puppylinux.com/viewtopic.php?p=152769#p152769
...well, I got a 20-second delay. But, I then rebooted, without saving the session, and it booted up without any delay ...huh, that doesn't make any sense!!!
I noticed something, with having booted with the audio CD inserted, pressing the eject button on the tray doesn't work, but "eject /dev/sr0" does. Why should I be stopped from manually ejecting the CD?
The culprit is this rule: /usr/lib/udev/rules.d/60-cdrom_id.rules -- so I have removed it.
That useless rule brings me onto something else: the majority of rules in /usr/lib/udev/rules.d are useless. In fact, some can cause trouble, and cause freeze at bootup.
Easy Scarthgap, built with packages compiled in OpenEmbedded, has a very small collection of udev rules. I also used that small collection in Easy Daedalus, and I have now done the same in Easy Excalibur -- yes, have thrown at all the rules that Devuan/Debian has provided. Result, much less chance of getting a freeze at bootup, and none of those missing rules have any adverse impact whatsoever.
I have been trying to analyze how udevd works. Increasing the
children helped to reduce occurrence of a timeout. The log shows
that it is still hitting the 64 limit, so perhaps might increase
it further. Though, I don't know how much that will stress an old
computer.
Tags: easy