[winswitch] "Simultanuous" start/upgrade

Antoine Martin antoine at nagafix.co.uk
Sun Nov 30 20:53:03 GMT 2014


Replying to the second half.

On 30/11/14 10:40, Lukas Haase wrote:
>>> My plan is to create a script that I run within screen and does the following:
>>> 1.) Starting xpra with a certain child. If the session already exists, upgrade
>>> 2.) Only if the child exits, the script should exit
>>> 3.) Otherwise (e.g., xpra crashes), xpra upgrade should run in a loop.
>>>
>>> Would xpra provide "xpra upgrade-or-start :1111" this would be cheesy :-)
>> We don't normally do band aids, but this feature could be useful on its own.
>> [...]
>> Implementing upgrade-or-start is probably easier than that, and more
>> importantly, reliable.
> :-) Does it mean I can file a feature request for it?
Sure.
>> [...]
>>> Is it better/more stable to query a session with something like "xpra list | grep :1111" and the do either start or upgrade?
>>> How do I best implement the behavior that the script upgrades if it is ran twice and continues the loop but starts if it not?
>> If you really want to script it, you can just use:
>> xpra version :1111
>> And check the exit code.
> But how do I distinguish between "crashed/upgradeable" and "not running at all"?
>
> xpra successfully running:
> $ xpra version :1111; echo $?
> 0.14.12
> 0
>
> xpra not running at all:
> $ xpra version :1111 ; echo $?
> xpra initialization error: connection failed: [Errno 2] No such file or directory
> 1
>
> xpra crashed but not Xserver/aplication (using the "--no-mdns" method described above):
> $ xpra version :1111 ; echo $?
> xpra initialization error: connection failed: [Errno 111] Connection refused
> 1
>
> It seems that it would be distinguishable if xpra would return the Errno code.
> Or I could grep the stderr output which is not very elegant.
Not elegant, but that's all we have right now.
Feel free to file a request for that one too.

Antoine



More information about the shifter-users mailing list