Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am running some computation on my Linux box and can't really afford to run it on battery while I drive home. It requires a network connection and currently I am running this stuff on a wireless connection. After reaching home, I need to hook up an ethernet cable to get the Internet.

I've never done this before but I want to "resume" the computation after reaching home. For that, I am thinking that I should suspend the eclipse program (which apparently I did not start from a terminal, so how would I suspend it?), put the system into standby. Then get the system out of standby, connect the ethernet cable, get a new IP address, then resume eclipse. I am assuming it will work. Anyone has a better approach?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

Since you mentioned you're running Linux, you can use the kill command with the -STOP and -CONT arguments might be a more appropriate option to pause and resume the process.

First, open a terminal and get the PID using

ps aux

Then run

kill -STOP pid

where pid is the PID of your Java process.

To resume, run

kill -CONT pid

Brief tutorial here: http://tombuntu.com/index.php/2007/11/23/how-to-pause-a-linux-process

Another method would be to run your program in debug mode in Eclipse and pause it in the Debug view. However, running in debug mode will incur a nasty performance hit.

Note that the network connection in your program will probably need to be reopened (either due to changing networks or due to your connection getting closed due to timeout out on the other side), so you'll have to code some logic to detect a dropped network connection and reconnect.

share|improve this answer
    
Thanks... That works...! :) –  Legend Nov 14 '09 at 2:06

You can probably do it by running Jconsole.exe that is included within the Jre bin directory. Inside there, there is a way to send a pause "Operation" probably...

share|improve this answer
    
This is on my linux box by the way... –  Legend Nov 14 '09 at 1:25
    
doesn't the linux version of jdk also have jconsole ? –  djangofan Nov 16 '09 at 15:52

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.