# Linux – Recover an application in sleeping state after an X server crash

linuxprocesssleepx-serverxorg

I often run calculations on my Linux computer, which cause my X server to crash from time to time. Almost always, some programs seem to survive to the crash and are in an interruptible sleeping state, for example:

29315 ?        Sl    54:35 /home/kashim/Desktop/anylogic/anylogic -vmargs -Xmx1024M


Is there a way to reconnect these applications with the new X server?

Not without some prior preparation. There are proxy Xservers, such as XMX or xmove that would allow you to reconnect the proxy to a new Xserver in theory, thus when the displaying Xserver crashes, you can migrate to a new one, but they do have their limitations. XMX is designed for screencasting of a sort, and xmove is designed for user-initiated migration, not recovering from a crashed Xserver.

There are also applications like Xpra, and Xvnc that would allow you to run a second Xserver that does not display to the screen, then "attach" to those Xservers from another Xserver, thus if your displaying Xserver crashes, you can simply reattach.

Finally, there was a utility Guievict that used runtime code patching to migrate an application without its consent to another Xserver, but I find it doubtful that that would work in a modern environment.

Refs:

http://en.wikipedia.org/wiki/Xmove

http://en.wikipedia.org/wiki/Xpra

http://en.wikipedia.org/wiki/Guievict