summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2013-09-10 16:56:10 +0200
committerJohn Crispin <blogic@openwrt.org>2013-09-13 17:37:26 +0200
commit66d3d15c27e258fe51ef27267a1ddb004137dd65 (patch)
treed18801189ed17102ff953549a2ce95783dc3e2b1
parentd4f72a9102c8ce5996f1c340e56d68c07eeda043 (diff)
downloadunitd-66d3d15c27e258fe51ef27267a1ddb004137dd65.tar
unitd-66d3d15c27e258fe51ef27267a1ddb004137dd65.zip
coldplug: only start hotplug timer after udevtrigger finished
Currently the last event timer for hotplug is started after the udevtrigger process is forked. Starting the timer means that the first hotplug event must come in before the timer expires. During this time the kernel must load the binary of the udevtrigger from the underlying rootfs which can be time consuming on slow systems. On such systems, the timer expires before the first hotplug event happens which results in broken behaviour. Due to the missing device nodes, not the ubus nor the procd code works correctly in that case. Change the code to only start the hotplug last event timer after the udevtrigger process finishes. This ensures that the delay caused by accessing the underlying filesystem does not affects the desired behaviour. Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
-rw-r--r--coldplug.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/coldplug.c b/coldplug.c
index d5997f8..b8c0eaf 100644
--- a/coldplug.c
+++ b/coldplug.c
@@ -34,6 +34,7 @@ static void coldplug_complete(struct uloop_timeout *t)
static void udevtrigger_complete(struct uloop_process *proc, int ret)
{
DEBUG(2, "Finished udevtrigger\n");
+ hotplug_last_event(coldplug_complete);
}
void procd_coldplug(void)
@@ -59,7 +60,6 @@ void procd_coldplug(void)
return;
}
- hotplug_last_event(coldplug_complete);
uloop_process_add(&udevtrigger);
DEBUG(2, "Launched coldplug instance, pid=%d\n", (int) udevtrigger.pid);