xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.

Opened 4 years ago

Closed 4 years ago

Last modified 8 months ago

#1599 closed defect (fixed)

ssh start may run xpra command multiple times

Reported by: Antoine Martin Owned by: Antoine Martin
Priority: major Milestone: 2.2
Component: server Version: trunk
Keywords: ssh Cc:

Description (last modified by Antoine Martin)

We should ensure that we only start a single instance with "proxy_start" by using if+elif+else statements.

With r16498, the proxy start command line ends up looking like this:

XPRA_SSH_DEBUG=1 xpra start ssh:test@localhost --start=xterm
executing ssh command: "ssh" "-x" "-l" "guest" "-T" "localhost" "sh -c 'xpra initenv;\
    ~/.xpra/run-xpra _proxy_start "--start=xterm" \
    || $XDG_RUNTIME_DIR/xpra/run-xpra _proxy_start "--start=xterm" \
    || xpra _proxy_start "--start=xterm" \
    || /usr/local/bin/xpra _proxy_start "--start=xterm"'"

Which means we can run the same subcommand N times (here N=4) if it fails.
This causes problems if we're trying to start a server... as we could end up starting it N times.

Change History (4)

comment:1 Changed 4 years ago by Antoine Martin

Description: modified (diff)
Status: newassigned

r16499 does this, the ssh command line looks like this now:

executing ssh command: "ssh" "-x" "-l" "guest" "-T" "localhost" "sh -c 'xpra initenv;\
    if [ -x "~/.xpra/run-xpra" ]; then ~/.xpra/run-xpra _proxy_start "--start=xterm";\
    elif [ -x "$XDG_RUNTIME_DIR/xpra/run-xpra" ]; then $XDG_RUNTIME_DIR/xpra/run-xpra _proxy_start "--start=xterm";\
    elif type "xpra" > /dev/null 2>&1; then xpra _proxy_start "--start=xterm";\
    elif [ -x "/usr/local/bin/xpra" ]; then /usr/local/bin/xpra _proxy_start "--start=xterm";\
    else echo "no run-xpra command found"; exit 1; fi'"

It is very very late in the release cycle (2.1 has already been tagged: r16496), but I am considering this for inclusion in 2.1

comment:2 Changed 4 years ago by Antoine Martin

Summary: ssh start and non-posix shellsssh start may run xpra command multiple times

(edit ticket title)

Version 0, edited 4 years ago by Antoine Martin (next)

comment:3 Changed 4 years ago by Antoine Martin

Resolution: fixed
Status: assignedclosed

Was included in the 2.1 release: r16505.

comment:4 Changed 8 months ago by migration script

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/1599

Note: See TracTickets for help on using tickets.