X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=tools%2Fvirt-rescue;h=7a87fbcffd8930bab5a206c30849eef03798f25b;hp=1f292f6071968c0e2b4b0ad3e36d0a40a681451e;hb=c6c030b64bab98602363485cb62a9e1d847d570e;hpb=f35365ecbf348f1030581e59795435987b8adf0f diff --git a/tools/virt-rescue b/tools/virt-rescue index 1f292f6..7a87fbc 100755 --- a/tools/virt-rescue +++ b/tools/virt-rescue @@ -19,6 +19,7 @@ use warnings; use strict; +use Errno; use Sys::Guestfs; use Sys::Guestfs::Lib qw(open_guest); use Pod::Usage; @@ -212,9 +213,13 @@ my $str = "guestfs_rescue=1"; $str .= " $append" if defined $append; $g->set_append ($str); -# Run the appliance. This won't return until the user quite the +# Run the appliance. This won't return until the user quits the # appliance. -$g->launch (); +eval { $g->launch (); }; + +# launch() expects guestfsd to start. However, virt-rescue doesn't run guestfsd, +# so this will always fail with ECHILD when the appliance exits unexpectedly. +die $@ unless $!{ECHILD}; exit 0;