[CRIU] Pty-related Dump Failure

Saied Kazemi saied at google.com
Tue Mar 10 13:23:10 PDT 2015


Yes it can be done in 3 steps:

1) Build nsinit
# creates test_cr directory and puts all source files there
# view/edit criu arguments (e.g., --shell-job) in test_cr/src/
github.com/docker/libcontainer.go
$ ./build_nsinit.sh

2) Start a container
# screates busybox_cr directory
$ ./start_container.sh

3) Checkpoint (or restore) a container
# on a different terminal
$ cd busybox_cr
$ sudo nsinit -criu /path/to/criu checkpoint (restore)

Notice that because checkpoint terminates the process, the existing code
removes the directory where CRIU image files are.  Just comment out the
call to os.RemoveAll():

diff --git a/container_linux.go b/container_linux.go
index 1bce2b7..a6ab67d 100644
--- a/container_linux.go
+++ b/container_linux.go
@@ -226,9 +226,11 @@ func (c *linuxContainer) Destroy() error {
                }
        }
        err = c.cgroupManager.Destroy()
+       /*
        if rerr := os.RemoveAll(c.root); err == nil {
                err = rerr
        }
+       */
        c.initProcess = nil
        return err
 }

Please don't hesitate to let me know if you have any questions.

--Saied



On Tue, Mar 10, 2015 at 12:41 PM, Cyrill Gorcunov <gorcunov at gmail.com>
wrote:

> On Tue, Mar 10, 2015 at 12:38:39PM -0700, Saied Kazemi wrote:
> >    Yup, ttys are painful :(  I'll dig deeper too and check back with
> you.
> >    Please let me know if you need instructions to reproduce the problem.
>
> Look, this would be great if the problem could be reproduced with some
> minimum set of tools, is it possible?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvz.org/pipermail/criu/attachments/20150310/a61993da/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: build_nsinit.sh
Type: application/x-sh
Size: 499 bytes
Desc: not available
URL: <http://lists.openvz.org/pipermail/criu/attachments/20150310/a61993da/attachment-0002.sh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: start_container.sh
Type: application/x-sh
Size: 184 bytes
Desc: not available
URL: <http://lists.openvz.org/pipermail/criu/attachments/20150310/a61993da/attachment-0003.sh>


More information about the CRIU mailing list