mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-17 16:47:50 +00:00
No description
blcrcheckpointcontainercontainerscriudmtcphighly-availablelinuxmemory-trackingmigrationparasitepost-copyrestoresnapshotsuspenduserfaultfdzero-downtime
Starting with version 3.15, the kernel provides a mnt_id field in
/proc/<pid>/fdinfo/<fd>. However, the value provided by the kernel for
AUFS file descriptors obtained by opening a file in /proc/<pid>/map_files
is incorrect.
Below is an example for a Docker container running Nginx. The mntid
program below mimics CRIU by opening a file in /proc/1/map_files and
using the descriptor to obtain its mnt_id. As shown below, mnt_id is
set to 22 by the kernel but it does not exist in the mount namespace of
the container. Therefore, CRIU fails with the error:
"Unable to look up the 22 mount"
In the global namespace, 22 is the root of AUFS (/var/lib/docker/aufs).
This patch sets the mnt_id of these AUFS descriptors to -1, mimicing
pre-3.15 kernel behavior.
$ docker ps
CONTAINER ID IMAGE ...
3850a63ee857 nginx-streaming:latest ...
$ docker exec -it 38 bash -i
root@3850a63ee857:/# ps -e
PID TTY TIME CMD
1 ? 00:00:00 nginx
7 ? 00:00:00 nginx
31 ? 00:00:00 bash
46 ? 00:00:00 ps
root@3850a63ee857:/# ./mntid 1
open("/proc/1/map_files/400000-4b8000") = 3
cat /proc/49/fdinfo/3
pos: 0
flags: 0100000
mnt_id: 22
root@3850a63ee857:/# awk '{print $1 " " $2}' /proc/1/mountinfo
87 58
103 87
104 87
105 104
106 104
107 104
108 87
109 87
110 87
111 87
root@3850a63ee857:/# exit
$ grep 22 /proc/self/mountinfo
22 21 8:1 /var/lib/docker/aufs /var/lib/docker/aufs ...
44 22 0:35 / /var/lib/docker/aufs/mnt/<ID> ...
$
Signed-off-by: Saied Kazemi <saied@google.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
|
||
|---|---|---|
| arch | ||
| contrib | ||
| Documentation | ||
| include | ||
| lib | ||
| pie | ||
| protobuf | ||
| pycriu | ||
| scripts | ||
| test | ||
| .gitignore | ||
| .mailmap | ||
| .travis.yml | ||
| action-scripts.c | ||
| aio.c | ||
| bfd.c | ||
| cgroup.c | ||
| COPYING | ||
| cr-check.c | ||
| cr-dedup.c | ||
| cr-dump.c | ||
| cr-errno.c | ||
| cr-exec.c | ||
| cr-restore.c | ||
| cr-service.c | ||
| cr-show.c | ||
| CREDITS | ||
| crit | ||
| crtools | ||
| crtools.c | ||
| eventfd.c | ||
| eventpoll.c | ||
| fifo.c | ||
| file-ids.c | ||
| file-lock.c | ||
| files-ext.c | ||
| files-reg.c | ||
| files.c | ||
| fsnotify.c | ||
| image-desc.c | ||
| image.c | ||
| ipc_ns.c | ||
| irmap.c | ||
| kcmp-ids.c | ||
| kerndat.c | ||
| libnetlink.c | ||
| log.c | ||
| Makefile | ||
| Makefile.config | ||
| Makefile.crtools | ||
| Makefile.inc | ||
| mem.c | ||
| mount.c | ||
| namespaces.c | ||
| net.c | ||
| netfilter.c | ||
| page-pipe.c | ||
| page-read.c | ||
| page-xfer.c | ||
| pagemap-cache.c | ||
| parasite-syscall.c | ||
| pipes.c | ||
| plugin.c | ||
| proc_parse.c | ||
| protobuf-desc.c | ||
| protobuf.c | ||
| pstree.c | ||
| ptrace.c | ||
| rbtree.c | ||
| README | ||
| rst-malloc.c | ||
| sd-daemon.c | ||
| sd-daemon.h | ||
| security.c | ||
| shmem.c | ||
| sigframe.c | ||
| signalfd.c | ||
| sk-inet.c | ||
| sk-netlink.c | ||
| sk-packet.c | ||
| sk-queue.c | ||
| sk-tcp.c | ||
| sk-unix.c | ||
| sockets.c | ||
| stats.c | ||
| string.c | ||
| sysctl.c | ||
| sysfs_parse.c | ||
| timerfd.c | ||
| tty.c | ||
| tun.c | ||
| util.c | ||
| uts_ns.c | ||
criu ==== An utility to checkpoint/restore tasks. Using this tool, you can freeze a running application (or part of it) and checkpoint it to a hard drive as a collection of files. You can then use the files to restore and run the application from the point it was frozen at. The distinctive feature of the CRIU project is that it is mainly implemented in user space. The project home is at http://criu.org Pages worth starting with are * Kernel configuration, compilation, etc: http://criu.org/Installation * A simple example of usage: http://criu.org/Simple_loop * More sophisticated example with graphical app: http://criu.org/VNC