Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Note that this question is different than, but related to, "How do I suspend my computer?" It is also different than, but related to, questions about the "session management" capability in popular Linux desktop platforms.

Here's the scenario: It takes me 10 minutes to get my programming environment all set up the way I want it. I write a bunch of code. I go to sleep. The next morning I have to do something other than write code. Maybe it's compose a presentation. My coding tools are hogging a bunch of system resources, but I don't want to terminate them because they're a pain to set up again. Is there a way to take an application or group of applications and suspend them to disk in a kind of "live session" that I can then "unfreeze" later?

Note that this is a general problem; replace "programming environment" with "running a giant simulation" (or whatever) in the previous paragraph. It seems like this sort of thing should exist but maybe I just don't know what it's called. That, or there are some very good technical reasons for why it doesn't exist. I'm interested to hear about either.

Respondents should focus primarily on Linux desktop platforms. Though if, for example, this capability exists on Windows and not on Linux as a result of fundamental differences between them, I'd be interested to hear about it.

Thanks!

PS - Sorry for the namespace collisions in the problem description. Are there better terms than "suspend" and "session?"

share|improve this question

migrated from stackoverflow.com Jan 26 '11 at 17:20

This question came from our site for professional and enthusiast programmers.

2  
While not an answer to the question you asked, it might be worth researching if your programming environment can be better customized to start in the form you prefer, either via config files or even by modifications of the source code. You might also be able to do some sort of 'replay' of window manipulation events using xtest... –  Chris Stratton Jan 26 '11 at 17:03
    
@Chris: please post that as an answer. I want to vote it up. Also, you might want to point out that window managers often have settings to remember window positions and workspaces -- no need for xtest. (The precise way to do this will vary depending on the window manager.) –  Ken Bloom Jan 26 '11 at 18:22
1  
As @Chris pointed out, this question isn't about my programming environment. I could just as easily be running a massive simulation, which I also do on a regular basis. The problem is the same: How do I put the thing on ice and free up system resources without terminating it? –  BrianTheLion Jan 28 '11 at 15:48

5 Answers 5

up vote 0 down vote accepted

Take a look at http://cryopid.berlios.de/ It can save running programs to disk, and restore them later. I haven't tried it myself, though.

share|improve this answer
    
This is the kind of thing I was looking for! Thanks. –  BrianTheLion Jan 28 '11 at 15:34

Maybe you set up your perfect development environment with VirtualBox. This way you can freeze your current state reliably. You're in the same network environment and can access shared folders on the same machines.

The only other half-way-solution would be something like the preload-package/daemon. But some kind of virtualization seems the better approach for you.

share|improve this answer

I don't know a way to suspend an application to disk, like hibernation (although it is probably possible), but if you have a swap file sending your application a SIGSTOP signal will probably do just what you need.

share|improve this answer
1  
Granted, SIGSTOP cannot be ignored but I see two potential problems with using it: 1) Is there a guarantee that the kernel will free up the memory that the process is using? I doubt it. 2) Is there a guarantee that the kernel will STOP all child processes as well? I doubt that too. Those guarantees would have to be implemented as handlers on an app-by-app basis, hence it's not a general solution. –  BrianTheLion Jan 28 '11 at 15:43

Is it not possible to set up a script to configure your tools for you when you start them up, instead of having to spend 10 minutes doing so every time?

Failing that, you could try using "kill -STOP" and "kill -CONT", which should stop and continue the process respectively. See here

share|improve this answer
    
See my response to @fuzzyTew. –  BrianTheLion Jan 28 '11 at 15:44

You can use DMTCP to snapshot/restore a bundle of X server (for example, Xvfb) and your application.

But it's not right tool for "save up resources/speed up loading" job.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.