[CRIU] post-dump / pre-restore scripts

Eliot Moss moss at cs.umass.edu
Sat Oct 12 02:16:21 MSK 2019


On 10/11/2019 2:53 PM, Radostin Stoyanov wrote:
> On 11/10/2019 19:49, Radostin Stoyanov wrote:
>> On 11/10/2019 14:24, Eliot Moss wrote:
>>> Dear CRIU-ers --
>>>
>>> I am interested in periodically taking a snapshot of a collection of
>>> running processes that use pipes and FIFOs to communicate with each
>>> other, and that are creating large traces files as output.  My goal
>>> is to be able to restart after a system failure or shutdown.
>>>
>>> From my reading of the documentation, I will need to record current
>>> position in the output trace files using a post-dump action script,
>>> and truncate the files back to those positions in a corresponding
>>> pre-restore script.
>>>
>>> It would be very helpful to see an example of such a script. The
>>> documentation is (ahem) a bit minimal on how to accomplish this
>>> presumably straightforward intent.  Can someone help me out on this?
>>>
>>
>> A simple example of such script is
>>
>> https://github.com/checkpoint-restore/criu/blob/criu-dev/scripts/fake-restore.sh
>>
> or perhaps a better example:
> 
> https://github.com/checkpoint-restore/criu/blob/criu-dev/scripts/tmp-files.sh

Thanks.  The files in question are not ones that will be deleted, but as the
program runs, they will be extended (they're trace outout).  What I need to do,
I think, is record their current size on dump, and truncate them to that size
on restore.

They're large (often tens of Gb) so doing the tar, etc., would be slow and
wasteful of space.

(I was sort of surprised that CRIU would not simply reset the file pointer
to the saved value and drive on, since that would work fine in this case.)

But I can probably figure this out ... it's just painful to determine all
the filenames, etc.

Regards - Eliot


More information about the CRIU mailing list