Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--socket-dir option is ignored #1244

Closed
totaam opened this issue Jul 2, 2016 · 13 comments
Closed

--socket-dir option is ignored #1244

totaam opened this issue Jul 2, 2016 · 13 comments

Comments

@totaam
Copy link
Collaborator

totaam commented Jul 2, 2016

Issue migrated from trac ticket # 1244

component: core | priority: minor | resolution: fixed

2016-07-02 12:07:19: nyavango created the issue


Shortly telling, --socket-dir option has no effect. xpra start creates socket in default location, xpra attach seeks sockets in default location.

Steps to reproduce:

  1. create ${HOME}/.testXpra directory to store sockets
  2. run xpra --socket-dir=${HOME}/.testXpra start :19
  3. expects: socket number 19 in ${HOME}/.testXpra directory
  4. get: socket number 19 in ${HOME}/.xpra directory
  5. get: ${HOME}/.testXpra directory is empty
  6. run xpra --socket-dir=${HOME}/.testXpra
  7. expects: empty list, because ${HOME}/.testExpra is empty
  8. got: list contains single live session at :19

So, from practical perspective --socket-dir is ignored. But it is still correctly parsed. If I replace it with --socket-diir for example, I would get parse error.

version: 0.17.3
OS: Gentoo Linux, rolling release.

@totaam
Copy link
Collaborator Author

totaam commented Jul 2, 2016

2016-07-02 16:02:58: antoine uploaded file list-socket-dir-only.patch (0.7 KiB)

fix for xpra list - with just too many disadvantages

@totaam
Copy link
Collaborator Author

totaam commented Jul 2, 2016

2016-07-02 16:05:14: antoine changed owner from antoine to nyavango

@totaam
Copy link
Collaborator Author

totaam commented Jul 2, 2016

2016-07-02 16:05:14: antoine edited the issue description

@totaam
Copy link
Collaborator Author

totaam commented Jul 2, 2016

2016-07-02 16:05:14: antoine commented


The problem comes from the changes for #963: we now allow multiple sockets to be created for a single server.

The problem with the socket being created in the "wrong" directory comes from the fact that the bind option defaults to a specific path (~/.xpra/) in the default config we ship.
And so when we try to create the sockets, this takes precedence over socket-dir.
This should be fixed in r12947 by switching to "auto" by default.
You can workaround this by:

  • editing /etc/xpra/xpra.conf and setting bind to auto
  • using --bind=$HOME/.testXpra on the command line
  • using an absolute path for your socket on the command line, etc..

The second part (fixing "xpra list" to only search "socket-dir") is much harder to fix properly. The patch attached would only search socket-dir, but this is likely to cause more problems than it solves: it would make it impossible to list any sockets not found in "socket-dir" once this option is used. And that's bad, so I will probably just leave it as it is.

Please close if this works for you.

@totaam
Copy link
Collaborator Author

totaam commented Jul 3, 2016

2016-07-03 12:29:30: nyavango changed status from new to closed

@totaam
Copy link
Collaborator Author

totaam commented Jul 3, 2016

2016-07-03 12:29:30: nyavango set resolution to fixed

@totaam
Copy link
Collaborator Author

totaam commented Jul 3, 2016

2016-07-03 12:29:30: nyavango commented


I afraid socket-dir-only.patch is too forceful. DotExpra is seemed to be used not only for sockets, but for logs too.

I've tried to set bind option in /etc/xpra/xpra.conf file to auto, and it satisfies all practical needs. So the ticket itself not a bug, but explanation for how to use xpra features properly. There is no need to exclude .xpra sessions from listing explicitly. So all works, fine, it was just a misunderstanding after upgrading from 0.16.x version.

@totaam totaam closed this as completed Jul 3, 2016
@totaam
Copy link
Collaborator Author

totaam commented Jul 12, 2016

2016-07-12 17:52:23: antoine commented


Milestone renamed

@totaam
Copy link
Collaborator Author

totaam commented Mar 12, 2017

2017-03-12 15:00:18: mviereck commented


I'm facing this bug again in xpra v1.0.3-15051. Maybe I misunderstand something.
I checked the config files, bind ist set to auto. I also tried --bind=auto on command line, but the socket does not appear in the folder I specified with --socket-dir.
If I use --socket-dir along with --bind=/path/to/socketdir, the socket appears, but if I try to connect to it (with xpra client v0.17.6) I get this error:

2017-03-12 14:23:07,850 New unix-domain connection received on /x11docker/socket/f89aa1c31337-522
2017-03-12 14:23:07,864 Handshake complete; enabling connection
2017-03-12 14:23:08,070 Warning: xxhash python bindings not found
2017-03-12 14:23:08,071  no scrolling detection
2017-03-12 14:23:08,094 server error processing new connection from Protocol(unix-domain socket:/x11docker/socket/f89aa1c31337-522): No module named dbus
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/xpra/server/server_core.py", line 893, in _process_hello
    self.hello_oked(proto, packet, c, auth_caps)
  File "/usr/lib/python2.7/dist-packages/xpra/server/server_base.py", line 1115, in hello_oked
    self.default_speed, self.default_min_speed)
  File "/usr/lib/python2.7/dist-packages/xpra/server/source.py", line 357, in __init__
    self.dbus_server = dbus_exception_wrap(make_dbus_server, "setting up client dbus instance")
  File "/usr/lib/python2.7/dist-packages/xpra/server/dbus/dbus_common.py", line 12, in dbus_exception_wrap
    v = fn()
  File "/usr/lib/python2.7/dist-packages/xpra/server/source.py", line 355, in make_dbus_server
    from xpra.server.dbus.dbus_source import DBUS_Source
  File "/usr/lib/python2.7/dist-packages/xpra/server/dbus/dbus_source.py", line 7, in <module>
    from xpra.dbus.helper import dbus_to_native
  File "/usr/lib/python2.7/dist-packages/xpra/dbus/helper.py", line 7, in <module>
    import dbus
ImportError: No module named dbus
2017-03-12 14:23:08,097 Disconnecting client /x11docker/socket/f89aa1c31337-522:
2017-03-12 14:23:08,097  server error (error accepting new connection)

I have set --no-notifications on both server and client. xpra server is within a docker container, xpra client is on host.

As newer xpra versions can handle multiple sockets, can't just be created one more in the directory specified by --socket-dir? That would preserve backwards compatibility.

@totaam
Copy link
Collaborator Author

totaam commented Mar 12, 2017

2017-03-12 15:40:33: antoine commented


That's a completely different bug (you don't have python dbus installed), which is fixed in 1.0.4

@totaam
Copy link
Collaborator Author

totaam commented Mar 12, 2017

2017-03-12 17:10:20: mviereck commented


ok, thanks, installing python-dbus fixes that error.

But the core point persists: in xpra 1.03 --socket-dir only works with setting --bind=/path/to/socketdir. Setting --bind=auto does not work, no socket is created in the specified path.

Older versions of xpra does not accept --bind=/path/to/socketdir. I get:

cannot start server: failed to setup sockets: TCP port must be specified as [HOST]:PORT 

I know, you don't like it people using older versions ;-). But as I provide a tool for everyone, I try to be compatible with every xpra version that may be installed. I can (and do) recommend to install from your repo, but don't want my tool to fail if there is an older version on other systems.
I can make a workaround, checking xpra version and using different commands to run xpra depending on its version number.

It would be more nice if xpra is backwards compatible with -- socket-dir if the config file contains bind = auto. That was the way I understood your comment above.

@totaam
Copy link
Collaborator Author

totaam commented Mar 13, 2017

2017-03-13 10:09:24: antoine commented


@mviereck: try r15287, it does what you want - I guess it can be argued that this fixes command line backwards compatibility so this may get applied at some point to the 1.0.x branch - but it will need further testing first, 2.0 is likely to be released before the next 1.0 update anyway so this should happen.


As for "not liking people using older versions": what people do is their own business, but:

  • some distributions (Debian / Ubuntu in particular) ship outdated versions full of serious bugs (crashes or critical security issues) and I want no responsibility with the serious risks involved
  • dealing with bug reports on those versions is usually a waste of time (fixed already)

@totaam
Copy link
Collaborator Author

totaam commented Mar 28, 2017

2017-03-28 15:13:24: mviereck commented


Thank you, I've tested with xpra v2.0-15319, now --socket-dir works on its own again without using --bind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant