New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FS#2685 - Coldplug too soon; hotplug.d scripts not run for some events #7484
Comments
cshoredaniel: Also running udevtrigger manually causes the hotplug scripts to run correctly. |
Ogura: What sort of only "some" devices it are? |
cshoredaniel: It's a race condition so it depends on when the system 'decides' to enumerate the device. If the device is detected by the kernel too quickly, then it only gets early init coldplug event and not the full hotplug.json with a root fs. So it's not a specific type of type device, although USB is probably what most OpenWrt users will notice this with (because it's where most non-platform devices would be added to the system). Yes it almost certainly is the same as https://bugs.openwrt.org/index.php?do=details&task_id=2641. Not showing up in /dev is a symptom of the issue; check ''dmesg'' output and see if shows up there (i.e. if there kernel detected early in the boot). |
cshoredaniel: In the past ''udevtrigger'' was run during the ''/etc/init.d/boot'' script but IIRC that also caused (different) issues with duplicate hotplug events. |
luizluca: Related/Duplicated FS#1903, FS#996 |
luizluca: At least for sane-backends, the hotplug was running as expected. However, it was running before logger could send logs. So, all outputs got lost. I changed that output to /dev/kmsg to be able to read hotplug msgs. It would be nice if OpenWrt could keep logs from early stage. The only issue with sane-backends hotplug script was that it ran before usblp module was loaded. So, it could not grant the needed access. I just pushed a fix for that (while updating sane-backends too). Now it grants the same access when a device using usblp is plugged. After that, at least for p910nd and sane-backends, I could not reproduce any hotplug issue during boot. Daniel Dickinson, could you test if the new hotplug script fixes your issue (it can be used with an older sane version)? |
cshoredaniel: Ah! Thanks for looking into this, I was barking up the wrong tree. I will do a test later this week. |
cshoredaniel: I can confirm this solves the problem I was having. I guess this will have to be de-duplicated from the other issues. This may be similar to the other issues in root cause, but it may taking examining each individually. Probably the most import hint is to know that logging doesn't include some early events. Thanks again! |
cshoredaniel:
OpenWrt 19.07.0-rc2, latest openwrt-packages.
Occurs on at least ath79 but looking at the code this is not device-specific.
Looking at the procd code coldplug (udevtrigger) is called during 'early' init, which means that hotplug.d scripts are not yet present. Because /etc/init.d/boot (or any other initscript) no longer does a later call to udevtrigger, the events get missed).
If udevtrigger were called during regular init this wouldn't be an issue (but probably the coldplug is needed earlier as well for devices needed to boot the system.
See also #1903 and #996 (they are likely the same root cause).
The text was updated successfully, but these errors were encountered: