[CRIU] dump a process in the its own code

Pavel Emelyanov xemul at parallels.com
Tue Apr 30 11:52:56 EDT 2013


On 04/30/2013 10:27 AM, Chanho Park wrote:
>> -----Original Message-----
>> From: criu-bounces at openvz.org [mailto:criu-bounces at openvz.org] On Behalf
>> Of Pavel Emelyanov
>> Sent: Monday, April 29, 2013 8:50 PM
>> To: Chanho Park
>> Cc: crml
>> Subject: Re: [CRIU] dump a process in the its own code
>>
>> On 04/28/2013 09:53 AM, Chanho Park wrote:
>>> Hi all,
>>>
>>>
>>>
>>> I have silly questions about crtools.
>>>
>>> I want to call the crtools in the program context because we want to
>> make a snapshot of the program for launching time.
>>>
>>> During the program is initialized, the program can call the crtools
>> following its own decision.
>>>
>>> I think the program may know the best time to dump its context.
>>>
>>>
>>>
>>> However, there is big problem due to process tree.
>>>
>>> If the crtools is called by system() or fork()/exec() in the program,
>> dump will be failed because the process tree
>>>
>>> also contains crtools as a child process of the program.
>>>
>>>
>>>
>>> Is there any pretty way to address this problem?
>>
>> In the existing implementation, you can try to daemonize the crtools.
> 
> I see. Can I get the example code for it?

The daemon(3) function does most of what is required. You'd only need to call
setsid() to escape from session and that's it.

> If not, I'll try it and post it later :)
> Thanks
> 
> Best regards,
> Chanho Park
> 
> 
> 




More information about the CRIU mailing list