mirror of
https://github.com/troglobit/finit.git
synced 2026-10-06 07:43:43 +07: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:
+13
-9
@@ -350,7 +350,7 @@ int main(int argc, char* argv[])
|
||||
run_interactive("mdev -s", "Populating device tree");
|
||||
} else {
|
||||
char *cmd;
|
||||
char line[80];
|
||||
char line[256];
|
||||
|
||||
cmd = which("udevd");
|
||||
if (!cmd)
|
||||
@@ -364,8 +364,19 @@ int main(int argc, char* argv[])
|
||||
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_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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user