xpra icon
Bug tracker and wiki

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


Changes between Initial Version and Version 1 of Ticket #1599


Ignore:
Timestamp:
07/25/17 09:49:11 (4 years ago)
Author:
Antoine Martin
Comment:

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

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #1599

    • Property Status changed from new to assigned
  • Ticket #1599 – Description

    initial v1  
    1 The following patch would allow us to ensure that we only start a single instance with "proxy_start" by using if+elif+else statements.
    2 But this is posix shell compliant syntax... and some people still use crappy csh / tcsh shells.
    3 We can require a posix shell, try to start bash ourselves from the remote ssh command or just live with the fact that we can end up running the same command N times (as many as we have "remote-xpra" items). Not sure what is best.
     1We should ensure that we only start a single instance with "proxy_start" by using if+elif+else statements.
    42
     3With r16498, the proxy start command line ends up looking like this:
    54{{{
    6 --- xpra/scripts/main.py        (revision 16497)
    7 +++ xpra/scripts/main.py        (working copy)
    8 @@ -1836,16 +1836,18 @@
    9                  kwargs["stderr"] = PIPE
    10              remote_xpra = display_desc["remote_xpra"]
    11              assert len(remote_xpra)>0
    12 -            remote_commands = []
    13              socket_dir = display_desc.get("socket_dir")
    14 +            proxy_command = display_desc["proxy_command"]       #ie: "_proxy_start"
    15 +            display_as_args = display_desc["display_as_args"]   #ie: "--start=xterm :10"
    16 +            remote_cmd = ""
    17              for x in remote_xpra:
    18 -                #ie: ["~/.xpra/run-xpra"] + ["_proxy"] + [":10"]
    19 -                pc = [x] + display_desc["proxy_command"] + display_desc["display_as_args"]
    20 +                pc = ['if [ -x "%s" ]; then' % x] + \
    21 +                        [x] + proxy_command + display_as_args + \
    22 +                     ["el"]     #joined with the next "if" or "se" at the end
    23                  if socket_dir:
    24                      pc.append("--socket-dir=%s" % socket_dir)
    25 -                remote_commands.append((" ".join(pc)))
    26 -            #ie: ~/.xpra/run-xpra _proxy || $XDG_RUNTIME_DIR/run-xpra _proxy
    27 -            remote_cmd = " || ".join(remote_commands)
    28 +                remote_cmd += " ".join(pc)
    29 +            remote_cmd += "se echo 'no run-xpra command found'; exit 1; fi"
    30              if INITENV_COMMAND:
    31                  remote_cmd = INITENV_COMMAND + ";" + remote_cmd
    32              #putty gets confused if we wrap things in shell command:
     5XPRA_SSH_DEBUG=1 xpra start ssh:test@localhost --start=xterm
     6executing ssh command: "ssh" "-x" "-l" "guest" "-T" "localhost" "sh -c 'xpra initenv;\
     7    ~/.xpra/run-xpra _proxy_start "--start=xterm" \
     8    || $XDG_RUNTIME_DIR/xpra/run-xpra _proxy_start "--start=xterm" \
     9    || xpra _proxy_start "--start=xterm" \
     10    || /usr/local/bin/xpra _proxy_start "--start=xterm"'"
    3311}}}
     12Which means we can run the same subcommand N times (here N=4) if it fails.
     13This causes problems if we're trying to start a server... as we could end up starting it N times.