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.
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
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
Was included in the 2.1 release: r16505.
this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/1599