[CRIU] pstree C/R problems

Pavel Emelyanov xemul at parallels.com
Thu Sep 27 07:56:29 EDT 2012


On 09/27/2012 03:45 PM, Huang Qiang wrote:
> On 2012/9/27 19:03, Pavel Emelyanov wrote:
>> On 09/27/2012 11:59 AM, Huang Qiang wrote:
>>> HI:
>>> I use a simple code to test CRIU, when it runs, the ids seem like this:
>>>
>>> UID        PID  PPID  PGID   SID  C STIME TTY          TIME   CMD
>>> root     11988  9904 11988 11988  0 10:37 ?        00:00:00     sshd: root at pts/3
>>> root     11996 11988 11996 11996  0 10:37 pts/3    00:00:00       -bash
>>> root     12056 11996 12056 11996  0 10:38 pts/3    00:00:00         ./multitask_simple
>>> root     12057 12056 12056 11996  0 10:38 pts/3    00:00:00           ./multitask_simple
>>>
>>> then I run:
>>> # ./crtools dump -D /home/hq/image -t 12056
>>> it is successful.
>>>
>>> then restore it:
>>> # ./crtools restore -D /home/hq/image -t 12056
>>> I got error:
>>>  12057: Error (cr-restore.c:677): Requested sid 11996 doesn't match inherited 11952
>>>  12056: Error (cr-restore.c:633): 12057 exited, status=1
>>> Error (cr-restore.c:911): Someone can't be restored
>>>
>>>
>>> I read the pstree C/R code, and found that it didn't handle the situation that
>>> the root task is not the session leader. But if there is only one task in the tree,
>>> C/R can successful, otherwise, will face the error.
>>>
>>> Is this a bug? Or is CRIU has a limitation right now for the root task?
>>> And what's your plan for this situation?
>>
>> The plan is -- by default we should reject dumping a process tree if there's a session
>> in a tree whose leader is not taken into a dump. But there should be a special case in
> 
> If we really need that default, maybe we need more prompt for the usage, because
> we don't have a CRIU tool for the users to run their programs, so I think my usage
> is common and reasonable, and crtools should work for that, isn't it?

Yup. It will be prompted, that there's a session leader left overboard.

>> crtools (Cyrill is working on it) when we explicitly dump that state and on restore
>> let the tree inherit any sid from crtools.
>>
> 
> Agreed with this solution.
> 
>> Does this decision suit you?
>>
> 
> Yes, thanks, and would you please talk about my second question?

About born_sid mechanics? Andrey (in Cc) will help.

>>> I think we may also need a helper for root task, of course have other things to consider.
>>>
>>> BTW, the born_sid mechanism seems didn't do any really work for rebuild the pstree,
>>> but for the check. We may neither support the tree like this:
>>>         pid = 5
>>>         sid = 5
>>>            /
>>>           /
>>>       pid = 7
>>>       sid = 6
>>>          /
>>>         /
>>>     pid = 9
>>>     sid = 8
>>>
>>> Right?
>>>
>>> Since I didn't find any scheme for the the problems I mentioned above in the TODO
>>> list, if you guys have any plan or thoughts, could you share them here?
>>> And maybe I can help to do this work.
>>>
>>>
>>> regards.
>>> Huang Qiang
>>>
>>> _______________________________________________
>>> CRIU mailing list
>>> CRIU at openvz.org
>>> https://openvz.org/mailman/listinfo/criu
>>>
>>
>>
>> .
>>
> 
> 
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://openvz.org/mailman/listinfo/criu
> .
> 



More information about the CRIU mailing list