xpra icon
Bug tracker and wiki

Opened 5 months ago

Closed 5 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 (3)

comment:1 Changed 5 months 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 5 months ago by Antoine Martin

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

r16500 is also needed because:

$ sh -c 'if [ -x "~/.xpra/run-xpra" ]; then echo yes; else echo no; fi'
no
$ sh -c 'if [ -x ~/.xpra/run-xpra ]; then echo yes; else echo no; fi'
yes
Last edited 5 months ago by Antoine Martin (previous) (diff)

comment:3 Changed 5 months ago by Antoine Martin

Resolution: fixed
Status: assignedclosed

Was included in the 2.1 release: r16505.

Note: See TracTickets for help on using tickets.