<div dir="ltr">Tycho,<div><br></div><div>Thanks for looking into this. I knew that we can't fini_cgroup() here but because I am not familiar with the internals of cgroup restoration I just put it there as a quick hack to get criu successfully dump and restore my test container multiple times (didn't care about properties, etc.).<div><br></div><div>For a permanent fix, I have to defer to your judgement on the best way to dismantle the cgyard in the non-detached mode. I agree with you that it's a good idea to always fini_cgroup() as soon as we've fully restored cgroups, regardless of detached/non-detached mode.</div><div><br></div><div>--Saied</div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 18, 2015 at 10:59 AM, Tycho Andersen <span dir="ltr"><<a href="mailto:tycho.andersen@canonical.com" target="_blank">tycho.andersen@canonical.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Saied,<br>
<div><div class="h5"><br>
On Mon, Mar 16, 2015 at 12:03:37PM -0700, Saied Kazemi wrote:<br>
> If the --restore-detached command line option is not specified during<br>
> restore, CRIU should unmount and remove the temporary cgyard directory<br>
> tree before waiting for the restored process to exit. Otherwise, all<br>
> the temporary cgyard mount points will remain mounted and visible.<br>
><br>
> Signed-off-by: Saied Kazemi <<a href="mailto:saied@google.com">saied@google.com</a>><br>
> ---<br>
> cr-restore.c | 4 +++-<br>
> 1 file changed, 3 insertions(+), 1 deletion(-)<br>
><br>
> diff --git a/cr-restore.c b/cr-restore.c<br>
> index 4a1fe4e..24d9f8b 100644<br>
> --- a/cr-restore.c<br>
> +++ b/cr-restore.c<br>
> @@ -1845,8 +1845,10 @@ static int restore_root_task(struct pstree_item *init)<br>
><br>
> write_stats(RESTORE_STATS);<br>
><br>
> - if (!opts.restore_detach && !opts.exec_cmd)<br>
> + if (!opts.restore_detach && !opts.exec_cmd) {<br>
> + fini_cgroup();<br>
> wait(NULL);<br>
> + }<br>
<br>
</div></div>Good catch.<br>
<br>
I don't think we can do this here, because immediately after<br>
restore_root_task() is called, prepare_cgroup_properties() is called,<br>
which needs the cg yard to do its work. This brings up an interesting<br>
point though: currently if we don't --restore-detached, the cg<br>
properties aren't (attempted to be) restored until after the task<br>
exits, which is not good. Should the prepare_cgroup_properties() call<br>
be moved into restore_root_task()?<br>
<br>
Also, is there any reason not to fini_cgroup() all the time once we've<br>
prepare_cgroup_properties(), not just in non-detached mode?<br>
<br>
Tycho<br>
<br>
> return 0;<br>
<span class="HOEnZb"><font color="#888888">><br>
> --<br>
> 2.2.0.rc0.207.ga3a616c<br>
><br>
</font></span></blockquote></div><br></div>