Re: [PATCH virt-viewer] replace nc with socat

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 02, 2014 at 05:32:45PM +0200, Marc-André Lureau wrote:
> It turns out that nc does not leave on server disconnect, and there
> doesn't seem to be any option to do that, leaving client open, and
> a bunch of idle processes.
> 
> Replacing nc with socat solves that, client is disconnected when
> the VM is shut down, when the sever connection is closed.
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1030487

Hmm, there's some talk in libvirt code about this kind of issue

    /*
     * This ugly thing is a shell script to detect availability of
     * the -q option for 'nc': debian and suse based distros need this
     * flag to ensure the remote nc will exit on EOF, so it will go away
     * when we close the connection tunnel. If it doesn't go away, subsequent
     * connection attempts will hang.
     *
     * Fedora's 'nc' doesn't have this option, and defaults to the desired
     * behavior.
     */
    virCommandAddArgFormat(cmd,
         "'if '%s' -q 2>&1 | grep \"requires an argument\" >/dev/null 2>&1; then "
             "ARG=-q0;"
         "else "
             "ARG=;"
         "fi;"
         "'%s' $ARG -U %s'",
         quoted, quoted, path);


but it looks like this is referring to the client end of the connection.
So possibly server side is handled differently.

The problem with just switching to 'socat' is that we don't have any
way to guarantee it is installed on the server that we're connecting
to.  With 'nc', the RPM containing the libvirt daemon will ensure the
nc RPM is installed. The same isn't true for socat and there's nothing
else we can rely on to pull it in indirectly. Adding a dep on socat
from virt-viewer RPM doesn't help since obviously virt-viewer is only
installed on the client, not the server.

So I don't think we can make this change to socat. Or at least if we
do, then we must make sure it silently falls back to 'nc' if socat
is not present.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list





[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux