Multiplexing of flint
The bliss session is multiplexed via tmux but Flint is not. I would like if flint can be multiplexed together with the session. If not, at least get it start on the display of the last client to connect instead of the first client.
Too much information follows:
Someone (re)starts a bliss session from their computer and now when I connect I cannot start and view a scan because flint cannot not be opened on their display (maybe they disconnected?):
OPTICS [10]: dscan(llrz2,-0.01,0.01,10,0.1,llrz2_enc)
WARNING 2020-03-26 17:33:35,383 flint: Flint starting...
ERROR 2020-03-26 17:33:51,925 flint: Flint can't start. You can enable the logs with the following line.
ERROR 2020-03-26 17:33:51,925 flint: SCAN_DISPLAY.flint_output_enabled = True
<class 'function'>
!!! === ValueError: flint: cannot retrieve Flint RPC server address from pid '22145` === !!! ( for more details type cmd 'last_error' )
It can be fixed by restarting the session to steal the display. At ID11 this is a frequent problem as lid11eh3 and lid11deb1 are 60 meters apart and both use the optics session. When you exit bliss, the other PC loses their optics window too. If you just close the terminal (top right X button, or c-b d) then the other guy keeps their session and does not need to restart.
I figured out to steal the flint window like this:
$ echo $DISPLAY
localhost:541
$ optics
... connects to existing session...
optics[8]: import os;os.environ["DISPLAY"]=localhost:541
... and now I will get flint via my ssh -X
. But it is broken for the other screen after I disconnect (unless I set to ":0" and then it goes to screen of the PC where bliss runs).
Some potential solutions / workarounds :
-
have some DISPLAY defaults per beamline to choose from (lid11deb1/lid11eh3 for ID11)
-
use the DISPLAY of tmux client that asked for the plot. Maybe bliss.shell.cli.main.py can save DISPLAY's before it goes into tmux to catch ssh -X tunnels.
-
use something like https://xpra.org/ to multiplexing the display as well as the shell.