summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--daemon/guestfsd.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c
index 487662f2..5c848497 100644
--- a/daemon/guestfsd.c
+++ b/daemon/guestfsd.c
@@ -269,6 +269,17 @@ main (int argc, char *argv[])
exit (EXIT_FAILURE);
}
+ /* Wait for udev devices to be created. If you start libguestfs,
+ * especially with disks that contain complex (eg. mdadm) data
+ * already, then it is possible for the 'mdadm' and LVM commands
+ * that the init script runs to have not completed by the time the
+ * daemon starts executing library commands. (This is very rare and
+ * hard to test however, but we have seen it in 'brew'). Run
+ * udev_settle, but do it as late as possible to minimize the chance
+ * that we'll have to do any waiting here.
+ */
+ udev_settle ();
+
/* Send the magic length message which indicates that
* userspace is up inside the guest.
*/