[libvirt] Syntax error "Bad fd number" when stopping libvirt-guests

Eric Blake eblake at redhat.com
Mon Dec 6 18:04:54 UTC 2010


On 12/05/2010 10:53 AM, Laurent Léonard wrote:
> Hi,
> 
> When libvirt-guests is being stopped, I get the following message:
> $Running guests on default URI: test-vm
> $Suspending guests on default URI...
> $Suspending test-vm: /etc/init.d/libvirt-guests: 340: Syntax error: Bad fd 
> number
> 
> The size of RAM already dumped should be displayed instead.
> 
> The attached patch fixes that issue.

>          sleep 1
> -        kill -0 $virsh_pid >&/dev/null || break
> +        kill -0 $virsh_pid 2>/dev/null || break

Almost.  '&> word' and '>& word' on non-integer word are bash-isms
(actually, &> is preferred, because '>&$x' is ambiguous if you don't
know if x expands to an integer or a file name), and bash treats both as
shorthand for '> word 2>&1'.  Therefore, the correct replacement for
dash (or any other POSIX shell that doesn't understand bash's extension)
would be:

kill -0 $virsh_pid >/dev/null 2>&1 || break

At any rate, ACK with that squashed in, so I pushed it.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20101206/c479cdae/attachment-0001.sig>


More information about the libvir-list mailing list