<div dir="ltr">Hi Tycho,<div><br></div><div>I tried the patch but it didn't work for me as cgyard is visible after restore (please see below). Here are criu dump and restore commands. I've also attached the log files.</div><div><br></div><div><div>criu dump -v4 -D /home/saied/work/nsinit/busybox/nsinit/checkpoint -o dump.log --root /home/saied/work/nsinit/busybox --manage-cgroups --evasive-devices -t 31361</div></div><div><br></div><div><div>criu restore -v4 -D /home/saied/work/nsinit/busybox/nsinit/checkpoint -o restore.log --root /home/saied/work/nsinit/busybox --pidfile /home/saied/work/nsinit/busybox/nsinit/restoredpid --manage-cgroups --evasive-devices --inherit-fd fd[0]:pipe:[69253] --inherit-fd fd[1]:pipe:[69254] --inherit-fd fd[2]:pipe:[69255]</div></div><div><br></div><div>Any ideas why?!</div><div><br></div><div>--Saied</div><div><br></div><div>[Terminal A]</div><div>$ sudo nsinit exec -- sh -c 'while :; do mount >> /foo; sleep 3; done'</div><div><br></div><div>[Terminal B]</div><div>$ sudo nsinit -criu /usr/local/bin/criu checkpoint && echo OK</div><div>OK</div><div>$ </div><div><br></div><div>[Terminal A]</div><div>$ sudo nsinit -criu /usr/local/bin/criu restore</div><div><br></div><div>[Terminal B]</div><div>$ cat foo</div><div>...</div><div><div>rootfs on / type rootfs (rw)</div><div>/dev/disk/by-uuid/18ec1400-9724-446f-be66-f8426f43f206 on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)</div><div>none on /nsinit/checkpoint/.criu.cgyard.SOcu9c type tmpfs (rw,relatime)</div><div>none on /nsinit/checkpoint/.criu.cgyard.SOcu9c/cpuset type cgroup (rw,relatime,cpuset)</div><div>none on /nsinit/checkpoint/.criu.cgyard.SOcu9c/cpu type cgroup (rw,relatime,cpu)</div><div>none on /nsinit/checkpoint/.criu.cgyard.SOcu9c/cpuacct type cgroup (rw,relatime,cpuacct)</div><div>none on /nsinit/checkpoint/.criu.cgyard.SOcu9c/memory type cgroup (rw,relatime,memory)</div><div>none on /nsinit/checkpoint/.criu.cgyard.SOcu9c/devices type cgroup (rw,relatime,devices)</div><div>none on /nsinit/checkpoint/.criu.cgyard.SOcu9c/freezer type cgroup (rw,relatime,freezer)</div><div>none on /nsinit/checkpoint/.criu.cgyard.SOcu9c/blkio type cgroup (rw,relatime,blkio)</div><div>none on /nsinit/checkpoint/.criu.cgyard.SOcu9c/perf_event type cgroup (rw,relatime,perf_event)</div><div>none on /nsinit/checkpoint/.criu.cgyard.SOcu9c/hugetlb type cgroup (rw,relatime,hugetlb)</div><div>none on /nsinit/checkpoint/.criu.cgyard.SOcu9c/systemd type cgroup (rw,relatime,name=systemd)</div><div>proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)</div><div>proc on /proc/sys type proc (rw,nosuid,nodev,noexec,relatime)</div><div>proc on /proc/bus type proc (rw,nosuid,nodev,noexec,relatime)</div><div>proc on /proc/irq type proc (rw,nosuid,nodev,noexec,relatime)</div><div>proc on /proc/sysrq-trigger type proc (rw,nosuid,nodev,noexec,relatime)</div><div>sysfs on /sys type sysfs (ro,nosuid,nodev,noexec,relatime)</div><div>tmpfs on /dev type tmpfs (rw,nosuid,relatime,mode=755)</div><div>devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=666)</div><div>mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)</div><div>shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=65536k)</div><div>tmpfs on /proc/kcore type tmpfs (rw,nosuid,relatime,mode=755)</div></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 19, 2015 at 7:50 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">We need to finalize the cg yard both on successful cgroup restore and on a<br>
failed restore. Further, we should restore the cgroup properties before<br>
allowing the task to continue in all modes (previously properties were only<br>
restored correctly in --restore-detached mode).<br>
<br>
CC: Saied Kazemi <<a href="mailto:saied@google.com">saied@google.com</a>><br>
Signed-off-by: Tycho Andersen <<a href="mailto:tycho.andersen@canonical.com">tycho.andersen@canonical.com</a>><br>
---<br>
cr-restore.c | 12 ++++++------<br>
1 file changed, 6 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/cr-restore.c b/cr-restore.c<br>
index 4a1fe4e..8d82945 100644<br>
--- a/cr-restore.c<br>
+++ b/cr-restore.c<br>
@@ -1798,6 +1798,11 @@ static int restore_root_task(struct pstree_item *init)<br>
if (ret < 0)<br>
goto out_kill;<br>
<br>
+ ret = prepare_cgroup_properties();<br>
+ fini_cgroup();<br>
+ if (ret < 0)<br>
+ goto out_kill;<br>
+<br>
ret = run_scripts(ACT_POST_RESTORE);<br>
if (ret != 0) {<br>
pr_err("Aborting restore due to script ret code %d\n", ret);<br>
@@ -1934,13 +1939,8 @@ int cr_restore_tasks(void)<br>
if (criu_signals_setup() < 0)<br>
goto err;<br>
<br>
- if (restore_root_task(root_item) < 0)<br>
- goto err;<br>
-<br>
- ret = prepare_cgroup_properties();<br>
-<br>
+ ret = restore_root_task(root_item);<br>
err:<br>
- fini_cgroup();<br>
cr_plugin_fini(CR_PLUGIN_STAGE__RESTORE, ret);<br>
return ret;<br>
}<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.1.0<br>
<br>
</font></span></blockquote></div><br></div>