["Followup-To:" header set to comp.os.linux.misc.]
useful_infos.TakeThisOut@yahoo.com staggered into the Black Sun and said:
> Suppose I've started a program that will take hours or even days to
> complete, and the program lacks any ability to stop and later resume.
The program needs to be fixed if it runs for multiple hours and doesn't
save its state periodically or have any way to resume without losing
everything. File a bug report.
> Is there any way to hiberate a process? By this I mean store its RAM
> to disk, freeze access to any files that it was accessing, and be able
> to resume [it] later?
I think the thing you're looking for has been implemented at least
partially. They called it "checkpointing" and said they were using it
to migrate processes among nodes of a cluster. IIRC, it required kernel
patches and that all files the process was accessing be on an NFS
server. So it wasn't a general solution, but you might want to Google
that keyword and see if it's been improved.
If your process isn't user-interactive, kill -STOP will stop it eating
CPU, but the process will still be using RAM until the VM shuffles it
off to swap. Using -STOP on user-interactive things like X clients can
cause them to react weirdly, so be careful. -CONT should start it up
again. HTH anyway,
--
"Dreams? Best leave dreams to those that can afford them."
--Aunt Cordelia, _Wizard and Glass_, Stephen King
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see