xpra icon
Bug tracker and wiki

Opened 7 years ago

Closed 7 years ago

#200 closed enhancement (fixed)

Eliminate the need to specify --socket-dir on the client side

Reported by: grumpfl Owned by: Antoine Martin
Priority: minor Milestone: 0.8
Component: core Version: 0.7.x
Keywords: Cc:

Description

It took me like an hour to get it working with a CIFS mounted $HOME -- including updating xpra from xpra.org (and not from default Ubuntu where it's in version 0.0.7.XXX). The problem was similar to #120, but I had a hard time finding the solution: using --socket-dir on both the server and the client side.

This is a bit redundant. Would it be possible to implement something along the following lines:

  1. The base location of the socket file is always ~/.xpra/$HOST-$DISPLAY (just as it's now without --socket-dir). If --socket-dir is given for "xpra start", the server creates a symlink (or, if that fails, a simple text file) at the "base location", pointing to the location of the "true" socket.
  1. With "xpra attach ssh:", the "base location" is tested for being a socket, a symlink or a simple text file; the "true" socket is used transparently.
  1. "xpra list" also won't need the --socket-dir anymore.

This could be even the default behavior: Try to create the socket at the base location, if that fails, try /tmp/xpra-$USER, if that fails, suggest using --socket-dir. By that, the use cases for --socket-dir would be greatly reduced. More importantly, the entry barrier would be lowered.

Change History (5)

comment:1 Changed 7 years ago by Antoine Martin

Priority: majorminor
Status: newaccepted

First of all, v0.0.7.x is so old, buggy and insecure that I do not understand why any distro would ship this code. Only irresponsible ones I guess.

As you found out, when you use NFS/CIFS home the sockets need to reside in /tmp (or just anywhere where sockets can be created and accessed, or you may want to use tcp sockets instead).

IIRC, specifying the socket dir can be done in /etc/xpra/xpra.conf, so you do not need to specify it every time you invoke xpra. I have not checked to see if the xpra proxy code invoked via ssh honours it, but it should, so then you should be able to specify it only once on the server and the clients will use this option transparently, without knowing about it. (please do let me know if that is not the case)

I like your idea of setting up symlinks to find the sockets no matter where they are. However, there are a number of difficulties here:

  • security issues with symlinks
  • some filesystem types may not allow such symlinks to be setup (and the text file option is a little inelegant)
  • shared HOME may point to sockets that do no exist
  • compatibility with older versions
  • the socket-dir option becomes ambiguous, and the behaviour of the application less predictable (or at least, harder to explain - man page, etc)

Nothing insurmountable here, but a change like this is bound to be more complicated to implement than first thought. I will try to fit it in this development cycle - but no promises made or implied here!

comment:2 Changed 7 years ago by grumpfl

Setting socket-dir in ~/.xpra/xpra.conf worked for me. Given that, I think it should be enough to mention in the man page that socket-dir should better be used in the server-side xpra.conf or on both client and server side from the command line.

comment:3 Changed 7 years ago by grumpfl

No, sorry, it did not. I set it in ~/.xpra/xpra.conf on the server side, but still the --socket-dir switch was required on the client side.

comment:4 Changed 7 years ago by Antoine Martin

Status: acceptednew

comment:5 Changed 7 years ago by Antoine Martin

Resolution: fixed
Status: newclosed

fixed in r2778

Note: See TracTickets for help on using tickets.