udevd timeout fixed
This has been a headache for the last month or so. See a recent post:
"The mysterious behaviour of udevd"
https://bkhome.org/news/202507/the-mysterious-behaviour-of-udevd.html
When a udev rule calls a program, binary or script, if it takes too
long, now set to 20 seconds, udevd will hang the bootup until the 20
second timeout, then kill the program. The default is 180 seconds, so at
least I reduced the freeze to something more reasonable.
The problem with scripts taking too long, has been tackled before, see this post from 2020:
"How to run long-time process on udev event"
https://bkhome.org/news/202012/how-to-run-long-time-process-on-udev-event.html
For example, this line from /etc/udev/rules.d/91-pup_event.rules:
ACTION=="add", SUBSYSTEM=="bluetooth", RUN+="/usr/local/pup_event/bluetooth-add"
What that 'bluetooth-add' script does is call 'bluetooth-add-run' and exit immediately, like this:
cttyhack sh /usr/local/pup_event/bluetooth-add-run &
However, the 'bluetooth-add' script has a couple of 'pidof' operations, for example:
pidof bluetooth-add-run >/dev/null
[ $? -eq 0 ] && exit 0
...finally, the penny dropped!
In Easy Excalibur, that pidof is from the sysvinit-utils package.
Prior EasyOS's use pidof from busybox. This new pidof is hanging, or
sometimes hanging. Inconsistent behaviour, and I'm wondering if the new
pidof can't handle multiple instances running at once. Or won't work
properly without a controlling tty, or something.
Anyway, have removed the pidof operations out of the scripts that
udevd calls directly, and now I'm consistently getting bootup without
the 20-second timeout. Now very fast to the desktop!
Tags: easy