[CRIU] Error CRIU restore because pid not matched

Christopher Covington cov at codeaurora.org
Fri Jan 2 10:54:18 PST 2015


Hi Aris,

On 12/31/2014 06:20 PM, Aris Setyawan wrote:
>> P.S. I'd appreciate if any discussion about CRIU happens with the mailing
>> list in Cc. My responsiveness throughput is limited :) but on the mailing
>> list there are quite a lot of other people that can help.
> 
> Ok.
> 
>> [1] http://criu.org/When_C/R_fails
> 
> Ok, I successfully restore it using unshare command, after dump it
> (test.sh process):
> 
> 	criu dump -t 422439 --images-dir /tmp/test --shell-job
> 	unshare -p --fork --mount-proc criu restore --images-dir /tmp/test  --shell-job
> 
> And the test.sh process, run as a child process (this is because we
> can not running restore with -d option):
> 
> 	$ ps ax | grep test
> 	 422516 pts/0    S      0:00 /path/unshare -p --fork --mount-proc
> /path/criu restore --images-dir /tmp/test --shell-job
> 	 422517 pts/0    S      0:00 /path/criu restore --images-dir
> /tmp/test --shell-job
> 	 422518 pts/0    S      0:15 /bin/sh ./test.sh
> 
> In my use case, I need to dump test.sh process again (and it's state)
> and then restore it again, then doing a computation. And then dump it
> again.
> 
> New problem, come. How I can dump the process again?

For simple situations you may be able to start a script in the new namespace
that restores, waits, and dumps again. If that won't work, you may want to
look into using the setns system call to enter the namespace.

http://man7.org/linux/man-pages/man2/setns.2.html

A brief look at the --namespaces option and the calls to switch_ns() [which
calls setns()] makes me think CRIU currently does not have such functionality,
but I may be misinterpreting or overlooking something.

Chris

-- 
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


More information about the CRIU mailing list