[winswitch] "Simultanuous" start/upgrade

Lukas Haase lukashaase at gmx.at
Sun Nov 30 06:20:44 GMT 2014


Unfortunately xpra is not so stable for me :-( - in two ways:
1.) Sometimes something on the client goes wrong and manually doing "xpra upgrade" helps
2.) Often xpra on the server crashes but leaving the X-server intact s "xpra upgrade" is possible.

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 :-)

Other than that I am asking myself what is the best way to achieve it otherwise. My current idea is:

xpra start :1111 --no-daemon --session-name=MATLAB --no-mdns --start-child="/opt/matlab/bin/matlab -desktop" --exit-with-children
if [ $? -eq 0 ]
        echo "xpra exited with status 0. Exiting ..."
        exit 0

while true
        echo xpra died, doing upgrade ...

        xpra upgrade :1111 --no-daemon --session-name=MATLAB --no-mdns --start-child="/opt/matlab/bin/matlab -desktop" --exit-with-children
        if [ $? -eq 0 ]
                echo "xpra exited with status 0. Exiting ..."
                exit 0

        echo "xpra exited with nonzero status, re-running the loop ..."
        sleep 3

Can I be sure that xpra returns 0 only if the child exited and nonzero otherwise (=crash, unexpected exit, ...)?
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?

Thanks for creative suggestions


More information about the shifter-users mailing list