[CRIU] [PATCH] criu: Add exec-cmd option.

Pavel Emelyanov xemul at parallels.com
Thu Mar 20 02:04:37 PDT 2014


On 03/20/2014 12:41 AM, Christopher Covington wrote:
> Hi Deyan,
> 
> On 03/19/2014 01:39 PM, Deyan Doychev wrote:
>> From: Deyan Doychev <deyandoichev at gmail.com>
>>
>> The --exec-cmd option specifies a command that will be execve()-ed on successful
>> restore. This way the command specified here will become the parent process of
>> the restored process tree.
>>
>> When this option is specified criu will fork to become a daemon before it starts
>> restoring the processes. It also implies the -d option so waiting for the
>> restored processes to finish is responsibility of the command specified here.
>>
>> This option will be used when restoring LinuX Containers.
> 
> I think it might be useful to document why you've chosen this implementation
> over the subreaper option (even if the answer is simple). I'm imagining that
> one possible benefit of the subreaper option is that the exec'd command could
> have its own standard I/O file descriptors. CRIU has -o, though, so I don't
> know if sharing would really be a problem. The environment is shared too,
> right? But again, I don't know if that'd really be a problem.

I see the reasoning for execve() over sub-reapers in -- if we call restore
via criu service, specifying subreaper would not work. Criu service will
be likely the top-most task in the hierarchy and it will not be able to
reparent the restore trees to any other task in the system. Calling execve
from service worker sub-task (and daemonizing it) should solve this.

Thanks,
Pavel


More information about the CRIU mailing list