Bug 592910

Summary: 'guestfish --remote run' hangs in a shell command substitution context
Product: [Community] Virtualization Tools Reporter: Jinxin Zheng <jzheng>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED UPSTREAM QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: unspecifiedCC: mbooth, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 730248 (view as bug list) Environment:
Last Closed: 2012-05-02 13:08:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 730248    
Bug Blocks:    
Attachments:
Description Flags
strace none

Description Jinxin Zheng 2010-05-17 10:45:08 UTC
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:

Comment 1 Richard W.M. Jones 2010-05-17 10:59:01 UTC
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

Comment 2 Richard W.M. Jones 2010-05-17 11:01:11 UTC
Created attachment 414520 [details]
strace

Output from:

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

Comment 3 Jinxin Zheng 2011-08-12 09:41:59 UTC
Can this one get at least a documentation fix?

Comment 4 Richard W.M. Jones 2011-08-12 09:56:19 UTC
Sure.  The bug wasn't cloned for 6.2, which is why it
had disappeared off the RHEL radar.

Cloned as bug 730248.

Comment 5 Richard W.M. Jones 2012-05-02 13:08:32 UTC
Documented upstream in commit 6cabc1cd02e181063596b48df55c3f6db51a6bb9.
We're not going to fix the bug itself.