Skip to content
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#996 - At boot /etc/hotplug scripts are not triggered by kernel events #5941

Open
openwrt-bot opened this issue Sep 2, 2017 · 2 comments
Labels

Comments

@openwrt-bot
Copy link

hpapagaj:

At boot /etc/hotplug.d scripts are not triggered by kernel events.
If we have a HDD/usb printer atached to an usb port, at boot, those scripts are not executed. However when we add/remove it later, after boot those scripts are executed properly.

Same problem as here:

[[https://dev.openwrt.org/ticket/18116|https://dev.openwrt.org/ticket/18116]]

I am using this hotplug script:

https://www.all4os.com/router/add-multiple-usb-printers-to-openwrt-firmware-router-via-p910nd-using-hotplug.html

@openwrt-bot
Copy link
Author

feckert:

Hello

This is because in preinit the procd hotplug script are not executed. This is the config in preinit.

https://git.lede-project.org/?p=source.git;a=blob;f=package/system/procd/files/hotplug-preinit.json;h=58afc6c696ff546f0f5da20fb9fc131f1afbd77c;hb=444add156f2a6d92fc15005c5ade2208a978966c

If system is running then procd is started with this config,

https://git.lede-project.org/?p=source.git;a=blob;f=package/system/procd/files/hotplug.json;h=e5f8d967e8c16c8dc85a437a5259c0ba840d766c;hb=444add156f2a6d92fc15005c5ade2208a978966c

and then hotplug scripts are executed on kernel events.

So i think it is not a bug.

@openwrt-bot
Copy link
Author

luizluca:

hotplug "coldplug" happens on early stage of booting, after preinit, but before modules are loaded. Maybe you need to get another hotplug event after the needed module was loaded. You might need to check other subsystem than hotplug.d/usb as hotplug.d/usbmisc or hotplug.d/block.

During early stage, you cannot use logger. You might need to debug your script echoing to a file: echo xxx >>/tmp/log.txt or to dmesg: echo xxx >>/dev/kmsg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant