Bug 730248

Summary: 'guestfish --remote run' hangs in a shell command substitution context
Product: Red Hat Enterprise Linux 6 Reporter: Richard W.M. Jones <rjones>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 6.1CC: jzheng, leiwang, mbooth, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: libguestfs-1.7.17-26.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 592910 Environment:
Last Closed: 2011-12-06 10:32:04 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 592910    

Description Richard W.M. Jones 2011-08-12 09:55:11 UTC
+++ This bug was initially created as a clone of Bug #592910 +++

Description of problem:
running 'guestfish --remote run' in a shell command substitution, i.e., `` or $()
would cause the command to hang.

Version-Release number of selected component (if applicable):
guestfish 1.3.13

How reproducible:
Always

Steps to Reproduce:
1. $ eval `guestfish -a test.img --listen`
2. a=`guestfish --remote run`
  
Actual results:
we get hang with step 2

Expected results:
the command should return on completion.

Additional info:

--- Additional comment from rjones on 2010-05-17 06:59:01 EDT ---

Easy to reproduce.

Something about guestfs_launch interferes with
stdout in a way which is incompatible with the remote
protocol.

Note this *doesn't* happen with any other command.  For example:

$ a=`guestfish --remote list-devices`
$ echo $a
/dev/vda
$ a=`guestfish --remote ping-daemon`
$ echo $a

--- Additional comment from rjones on 2010-05-17 07:01:11 EDT ---

Created attachment 414520 [details]
strace

Output from:

strace -o strace.log -f -s 1024 sh -c 'a=`guestfish --remote run`'

--- Additional comment from jzheng on 2011-08-12 05:41:59 EDT ---

Can this one get at least a documentation fix?

Comment 3 Jinxin Zheng 2011-08-23 09:14:29 UTC
Documented in man page for guestfish:

--
   REMOTE CONTROL RUN COMMAND HANGING
       Using the "run" (or "launch") command remotely in a command substitution context hangs, ie. don’t do (note the backquotes):

        a=`guestfish --remote run`

       Since the "run" command produces no output on stdout, this is not useful anyway.

Comment 4 errata-xmlrpc 2011-12-06 10:32:04 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2011-1512.html