xpra icon
Bug tracker and wiki

Opened 8 months ago

Closed 3 months ago

#2523 closed task (worksforme)

attach to existing server instead of trying to start another one on the same display

Reported by: Antoine Martin Owned by: stdedos
Priority: major Milestone: 4.0
Component: core Version: 3.0.x
Keywords: Cc:

Description (last modified by Antoine Martin)

See im writing a frontend for Xpra that will use ssh to connect... and xpra upgrade-or-start --use-display=auto.

Make it possible to start a new session if one does not exist, otherwise upgrade the existing one.
Also adding use-display=auto since the display may have been left behind by a server crash.

Change History (10)

comment:1 Changed 8 months ago by Antoine Martin

Description: modified (diff)
Status: newassigned

comment:2 Changed 7 months ago by Antoine Martin

r24791 adds use-display=auto

comment:3 Changed 6 months ago by Antoine Martin

See also #2426.

comment:4 Changed 6 months ago by stdedos

To get it right: This requires a v4.0 server?

comment:5 Changed 6 months ago by Antoine Martin

To get it right: This requires a v4.0 server?

Yes.
And for remote starts via ssh, this is likely to require a v4 client too.
We'll see once that part is implemented.

comment:6 Changed 4 months ago by Antoine Martin

Owner: changed from Antoine Martin to stdedos
Status: assignednew
Summary: upgrade-or-startupgrade-or-start: new --use-existing=yes|no|auto option

Done using a new --use-existing=yes|no|auto flag in r26091.

Usage examples:

xpra start ssh://host/10 --start=xterm --use-existing=yes

Can be repeated any number of times, only the first one will start new server.

xpra shadow ssh://host/ --use-existing=yes

If a server exists it is re-used and the connection succeeds.

EDIT: this syntax is now invalid, see comment:8.

Note: --use-existing=yes will be passed on to the server via the ssh command, if that server is a v3.0 or older then it won't know about this option and the whole thing will fail.

@stdedos: I think you will like this one.

Last edited 4 months ago by Antoine Martin (previous) (diff)

comment:7 in reply to:  6 Changed 4 months ago by stdedos

Replying to Antoine Martin:

@stdedos: I think you will like this one.

I like this one more 😛:

Note: --use-existing=yes will be passed to the server via the ssh command, if that server is a v3.0 or older then it won't know about this option and the whole thing will fail.

comment:8 Changed 4 months ago by Antoine Martin

Updates:

  • r26096 don't overwrite an existing server logfile until we've checked that the vfb has actually started
  • r26097 + r26099 refactoring
  • r26098 shortcut and run the client if we find the local server already exists
  • r26100 re-use attach
  • r26101 minor fixup

Ignore comment:6, I found a way to make it work just by overloading --attach=yes.
The --use-existing option has been removed, the benefit is that this will also degrade well with 3.x servers.

It is now even easier:

xpra start ssh://localhost/3 --start=xterm

Locally:

xpra start :3 --start=xterm --attach=yes
Last edited 3 months ago by Antoine Martin (previous) (diff)

comment:9 Changed 4 months ago by Antoine Martin

Summary: upgrade-or-start: new --use-existing=yes|no|auto optionattach to existing server instead of trying to start another one on the same display

comment:10 Changed 3 months ago by Antoine Martin

Resolution: worksforme
Status: newclosed
Note: See TracTickets for help on using tickets.