[CRIU] restore shell file in a different path

Pavel Emelyanov xemul at virtuozzo.com
Mon Aug 22 06:19:33 PDT 2016


On 08/22/2016 11:45 AM, Manuel Rodríguez Pascual wrote:
> Hi all,
> 
> I am working on an integration between CRIU and a resource manager. In
> order to do so, it would be really convenient to be able to restore an
> image from a different path (due to temporary files and so). The idea
> is run an script on /A/myScript.sh, checkpoint the whle process, move
> the script from /A to /B and then restore it from /B/myScript.sh . Is
> that possible with CRIU? 

Yes :)

> I am thinking in a flag like "criu restore
> --my_script_is=/B/myScript.sh" but I haven't found anything in the
> documentation.

Well, this is not the typical usage, so it's not documented.
In order to do so you can re-code the image files with crit tool. In
particular, the paths to files are stored in reg-files.img image, so
you'd have to do smth like

$ crit decode -i $img/reg-files.img | sed -e 's#/A/#/B/#' | crit encode -o $img/reg-files-new.img
$ mv $img/reg-files-new.img $img/reg-files.img

> 
> Thanks very much for your help. Best regards,
> 
> 
> Manuel
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu
> .
> 



More information about the CRIU mailing list