LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Continuing a process after shutdown ? (https://www.linuxquestions.org/questions/linux-newbie-8/continuing-a-process-after-shutdown-746432/)

ubuntu.diego 08-10-2009 08:28 AM

Continuing a process after shutdown ?
 
Hi y'all,

I know that it is possible to interrupt and continue processes in Linux, send them to the background and foreground. My question is regarding the following situation. I want to run a process (actually several, but i don't mind to do it one by one ) that is extremely long (it usually takes a month, or more). As you can imagine I can't have my computer on for a month without restarting. Does anyone know a way to do this ? I was thinking that the interrupt-continue capability of linux should allow me to do this... however I'm not sure I can continue a process after shutdown-reboot.

I know that one alternative could be to use checkpoints in my code (which is mostly R and Java) to achieve this, however, I would rather use an interrupt-continue framework.

Thanks in advance for your ideas or solutions !!!!

D.

karamarisan 08-10-2009 08:37 AM

I think you're gonna need checkpoints. The reason SIGSTOP and SIGCONT work is that the process's state in memory is preserved; it simply stops executing until told to continue. Obviously, that is not going to work if you power-cycle your machine (unless you're willing to trust a month's work to hibernate always working correctly). It doesn't seem likely to me that there's a library somewhere that allows you to 'hibernate' a single process, since that opens one of the largest cans of worms imaginable. If your program is writing to some file, is frozen and written to disk, and when it's restored, the file is gone, you are going to need some hardcore error-handling code, and that's probably on the low end of the bad that could produce.

Honestly, though, it shouldn't be much trouble to have a Linux system up for a month - I'll assume there's some external factor that makes that impossible. :)


All times are GMT -5. The time now is 03:38 PM.