From 15b9ed3ed2078c034f25bf3ba31298dd89c6cddf Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 11 Oct 2012 17:12:21 +0100 Subject: daemon: Call udev-settle at the start of the daemon. --- daemon/guestfsd.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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. */ -- cgit