mirror of
https://github.com/troglobit/finit.git
synced 2026-11-06 15:51:03 +00:00
In commit 34a1524 the start of udevd was refactored to allow it to be a
properly monitored service caused systems using eudev to malfunction.
This patch reverts part of that commit and adds a workaround found when
trying to reproduce issue #82 on Void Linux:
- Start a temporary udevd in the background
- Call udevadm to trigger bringup of all subsystems and devices
- Wait for everything to settle
- Tell temporary udevd to exit (new)
In the world of `mdev` this song and dance act is not required.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
dd8dd67106
commit
33916a2097
1 file changed
+13
-9
+13
-9
@@ -350,7 +350,7 @@ int main(int argc, char* argv[])
|
|||||||
run_interactive("mdev -s", "Populating device tree");
|
run_interactive("mdev -s", "Populating device tree");
|
||||||
} else {
|
} else {
|
||||||
char *cmd;
|
char *cmd;
|
||||||
char line[80];
|
char line[256];
|
||||||
|
|
||||||
cmd = which("udevd");
|
cmd = which("udevd");
|
||||||
if (!cmd)
|
if (!cmd)
|
||||||
@@ -364,8 +364,19 @@ int main(int argc, char* argv[])
|
|||||||
udev = 0;
|
udev = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
free(cmd);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
snprintf(line, sizeof(line), "%s --daemon", cmd);
|
||||||
|
run_interactive(line, "Populating device tree");
|
||||||
|
|
||||||
|
if (udev && whichp("udevadm")) {
|
||||||
|
run("udevadm trigger --action=add --type=subsystems");
|
||||||
|
run("udevadm trigger --action=add --type=devices");
|
||||||
|
run("udevadm settle --timeout=120");
|
||||||
|
run("udevadm control --exit");
|
||||||
|
}
|
||||||
|
|
||||||
|
free(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -419,13 +430,6 @@ int main(int argc, char* argv[])
|
|||||||
sm_init(&sm);
|
sm_init(&sm);
|
||||||
sm_step(&sm);
|
sm_step(&sm);
|
||||||
|
|
||||||
/* On udev systems we can now talk to udevd */
|
|
||||||
if (udev && whichp("udevadm")) {
|
|
||||||
run("udevadm trigger --action=add --type=subsystems");
|
|
||||||
run("udevadm trigger --action=add --type=devices");
|
|
||||||
run("udevadm settle --timeout=120");
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Network stuff
|
* Network stuff
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in new issue
Block a user