01c54c
'\" t
01c54c
.\"     Title: criu
01c54c
.\"    Author: [see the "AUTHOR" section]
72b139
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
72b139
.\"      Date: 03/09/2017
01c54c
.\"    Manual: CRIU Manual
72b139
.\"    Source: criu 2.12
01c54c
.\"  Language: English
01c54c
.\"
72b139
.TH "CRIU" "8" "03/09/2017" "criu 2\&.12" "CRIU Manual"
01c54c
.\" -----------------------------------------------------------------
01c54c
.\" * Define some portability stuff
01c54c
.\" -----------------------------------------------------------------
01c54c
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
01c54c
.\" http://bugs.debian.org/507673
01c54c
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
01c54c
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
01c54c
.ie \n(.g .ds Aq \(aq
01c54c
.el       .ds Aq '
01c54c
.\" -----------------------------------------------------------------
72b139
.\" * (re)Define some macros
72b139
.\" -----------------------------------------------------------------
72b139
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b139
.\" toupper - uppercase a string (locale-aware)
72b139
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b139
.de toupper
72b139
.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
72b139
\\$*
72b139
.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
72b139
..
72b139
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b139
.\" SH-xref - format a cross-reference to an SH section
72b139
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b139
.de SH-xref
72b139
.ie n \{\
72b139
.\}
72b139
.toupper \\$*
72b139
.el \{\
72b139
\\$*
72b139
.\}
72b139
..
72b139
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b139
.\" SH - level-one heading that works better for non-TTY output
72b139
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b139
.de1 SH
72b139
.\" put an extra blank line of space above the head in non-TTY output
72b139
.if t \{\
72b139
.sp 1
72b139
.\}
72b139
.sp \\n[PD]u
72b139
.nr an-level 1
72b139
.set-an-margin
72b139
.nr an-prevailing-indent \\n[IN]
72b139
.fi
72b139
.in \\n[an-margin]u
72b139
.ti 0
72b139
.HTML-TAG ".NH \\n[an-level]"
72b139
.it 1 an-trap
72b139
.nr an-no-space-flag 1
72b139
.nr an-break-flag 1
72b139
\." make the size of the head bigger
72b139
.ps +3
72b139
.ft B
72b139
.ne (2v + 1u)
72b139
.ie n \{\
72b139
.\" if n (TTY output), use uppercase
72b139
.toupper \\$*
72b139
.\}
72b139
.el \{\
72b139
.nr an-break-flag 0
72b139
.\" if not n (not TTY), use normal case (not uppercase)
72b139
\\$1
72b139
.in \\n[an-margin]u
72b139
.ti 0
72b139
.\" if not n (not TTY), put a border/line under subheading
72b139
.sp -.6
72b139
\l'\n(.lu'
72b139
.\}
72b139
..
72b139
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b139
.\" SS - level-two heading that works better for non-TTY output
72b139
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b139
.de1 SS
72b139
.sp \\n[PD]u
72b139
.nr an-level 1
72b139
.set-an-margin
72b139
.nr an-prevailing-indent \\n[IN]
72b139
.fi
72b139
.in \\n[IN]u
72b139
.ti \\n[SN]u
72b139
.it 1 an-trap
72b139
.nr an-no-space-flag 1
72b139
.nr an-break-flag 1
72b139
.ps \\n[PS-SS]u
72b139
\." make the size of the head bigger
72b139
.ps +2
72b139
.ft B
72b139
.ne (2v + 1u)
72b139
.if \\n[.$] \&\\$*
72b139
..
72b139
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b139
.\" BB/EB - put background/screen (filled box) around block of text
72b139
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b139
.de BB
72b139
.if t \{\
72b139
.sp -.5
72b139
.br
72b139
.in +2n
72b139
.ll -2n
72b139
.gcolor red
72b139
.di BX
72b139
.\}
72b139
..
72b139
.de EB
72b139
.if t \{\
72b139
.if "\\$2"adjust-for-leading-newline" \{\
72b139
.sp -1
72b139
.\}
72b139
.br
72b139
.di
72b139
.in
72b139
.ll
72b139
.gcolor
72b139
.nr BW \\n(.lu-\\n(.i
72b139
.nr BH \\n(dn+.5v
72b139
.ne \\n(BHu+.5v
72b139
.ie "\\$2"adjust-for-leading-newline" \{\
72b139
\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
72b139
.\}
72b139
.el \{\
72b139
\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
72b139
.\}
72b139
.in 0
72b139
.sp -.5v
72b139
.nf
72b139
.BX
72b139
.in
72b139
.sp .5v
72b139
.fi
72b139
.\}
72b139
..
72b139
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b139
.\" BM/EM - put colored marker in margin next to block of text
72b139
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72b139
.de BM
72b139
.if t \{\
72b139
.br
72b139
.ll -2n
72b139
.gcolor red
72b139
.di BX
72b139
.\}
72b139
..
72b139
.de EM
72b139
.if t \{\
72b139
.br
72b139
.di
72b139
.ll
72b139
.gcolor
72b139
.nr BH \\n(dn
72b139
.ne \\n(BHu
72b139
\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[]
72b139
.in 0
72b139
.nf
72b139
.BX
72b139
.in
72b139
.fi
72b139
.\}
72b139
..
72b139
.\" -----------------------------------------------------------------
01c54c
.\" * set default formatting
01c54c
.\" -----------------------------------------------------------------
01c54c
.\" -----------------------------------------------------------------
01c54c
.\" * MAIN CONTENT STARTS HERE *
01c54c
.\" -----------------------------------------------------------------
72b139
.SH "Name"
01c54c
criu \- checkpoint/restore in userspace
72b139
.SH "Synopsis"
01c54c
.sp
72b139
\fBcriu\fR \fIcommand\fR [\fIoption\fR \&...]
01c54c
.SH "DESCRIPTION"
01c54c
.sp
72b139
\fBcriu\fR is a tool for checkpointing and restoring running applications\&. It does this by saving their state as a collection of files (see the \fBdump\fR command) and creating equivalent processes from those files (see the \fBrestore\fR command)\&. The restore operation can be performed at a later time, on a different system, or both\&.
01c54c
.SH "OPTIONS"
01c54c
.SS "Common options"
01c54c
.sp
72b139
Common options are applicable to any \fIcommand\fR\&.
01c54c
.PP
72b139
\fB\-v\fR[\fBv\fR\&...]
01c54c
.RS 4
72b139
Increase verbosity up from the default level\&. Multiple
01c54c
\fBv\fR
72b139
can be used, each increasing verbosity by one level\&.
72b139
.RE
72b139
.PP
72b139
\fB\-v\fR\fInum\fR
72b139
.RS 4
72b139
Set verbosity level to
72b139
\fInum\fR\&. The higher the level, the more output is produced\&.
01c54c
01c54c
The following levels are available:
01c54c
.sp
01c54c
.RS 4
01c54c
.ie n \{\
01c54c
\h'-04'\(bu\h'+03'\c
01c54c
.\}
01c54c
.el \{\
01c54c
.sp -1
01c54c
.IP \(bu 2.3
01c54c
.\}
72b139
\fB\-v0\fR
72b139
no output;
72b139
.RE
72b139
.sp
72b139
.RS 4
72b139
.ie n \{\
72b139
\h'-04'\(bu\h'+03'\c
72b139
.\}
72b139
.el \{\
72b139
.sp -1
72b139
.IP \(bu 2.3
72b139
.\}
72b139
\fB\-v1\fR
72b139
only errors;
01c54c
.RE
01c54c
.sp
01c54c
.RS 4
01c54c
.ie n \{\
01c54c
\h'-04'\(bu\h'+03'\c
01c54c
.\}
01c54c
.el \{\
01c54c
.sp -1
01c54c
.IP \(bu 2.3
01c54c
.\}
72b139
\fB\-v2\fR
72b139
above plus warnings (this is the default level);
01c54c
.RE
01c54c
.sp
01c54c
.RS 4
01c54c
.ie n \{\
01c54c
\h'-04'\(bu\h'+03'\c
01c54c
.\}
01c54c
.el \{\
01c54c
.sp -1
01c54c
.IP \(bu 2.3
01c54c
.\}
72b139
\fB\-v3\fR
72b139
above plus information messages and timestamps;
01c54c
.RE
01c54c
.sp
01c54c
.RS 4
01c54c
.ie n \{\
01c54c
\h'-04'\(bu\h'+03'\c
01c54c
.\}
01c54c
.el \{\
01c54c
.sp -1
01c54c
.IP \(bu 2.3
01c54c
.\}
72b139
\fB\-v4\fR
72b139
above plus lots of debug\&.
01c54c
.RE
01c54c
.RE
01c54c
.PP
72b139
\fB\-\-pidfile\fR \fIfile\fR
01c54c
.RS 4
01c54c
Write root task, service or page\-server pid into a
72b139
\fIfile\fR\&.
01c54c
.RE
01c54c
.PP
72b139
\fB\-o\fR, \fB\-\-log\-file\fR \fIfile\fR
01c54c
.RS 4
01c54c
Write logging messages to
72b139
\fIfile\fR\&.
01c54c
.RE
01c54c
.PP
01c54c
\fB\-\-log\-pid\fR
01c54c
.RS 4
01c54c
Write separate logging files per each pid\&.
01c54c
.RE
01c54c
.PP
72b139
\fB\-\-display\-stats\fR
72b139
.RS 4
72b139
During dump as well as during restore
72b139
\fBcriu\fR
72b139
collects information like the time required to dump or restore the process or the number of pages dumped or restored\&. This information is always written to the files
72b139
\fIstats\-dump\fR
72b139
and
72b139
\fIstats\-restore\fR
72b139
and can be easily displayed using
72b139
\fBcrit\fR\&. The option
72b139
\fB\-\-display\-stats\fR
72b139
additionally prints out this information on the console at the end of a dump or a restore\&.
72b139
.RE
72b139
.PP
72b139
\fB\-D\fR, \fB\-\-images\-dir\fR \fIpath\fR
01c54c
.RS 4
72b139
Use
72b139
\fIpath\fR
72b139
as a base directory where to look for sets of image files\&.
01c54c
.RE
01c54c
.PP
72b139
\fB\-\-prev\-images\-dir\fR \fIpath\fR
01c54c
.RS 4
72b139
Use
72b139
\fIpath\fR
72b139
as a parent directory where to look for sets of image files\&. This option makes sense in case of incremental dumps\&.
01c54c
.RE
01c54c
.PP
72b139
\fB\-W\fR, \fB\-\-work\-dir\fR \fIdir\fR
01c54c
.RS 4
01c54c
Use directory
72b139
\fIdir\fR
01c54c
for putting logs, pidfiles and statistics\&. If not specified,
72b139
\fIpath\fR
01c54c
from
01c54c
\fB\-D\fR
01c54c
option is taken\&.
01c54c
.RE
01c54c
.PP
72b139
\fB\-\-close\fR \fIfd\fR
01c54c
.RS 4
72b139
Close file descriptor
72b139
\fIfd\fR
72b139
before performing any actions\&.
01c54c
.RE
01c54c
.PP
72b139
\fB\-L\fR, \fB\-\-libdir\fR \fIpath\fR
01c54c
.RS 4
72b139
Path to plugins directory\&.
01c54c
.RE
01c54c
.PP
72b139
\fB\-\-action\-script\fR \fIscript\fR
01c54c
.RS 4
72b139
Add an external action script to be executed at certain stages\&. The environment variable
01c54c
\fBCRTOOLS_SCRIPT_ACTION\fR
72b139
is available to the script to find out which action is being executed, and its value can be one of the following:
72b139
.PP
01c54c
\fBpre\-dump\fR
72b139
.RS 4
72b139
run prior to beginning a
01c54c
\fBdump\fR
01c54c
.RE
72b139
.PP
01c54c
\fBpost\-dump\fR
72b139
.RS 4
72b139
run upon
01c54c
\fBdump\fR
72b139
completion
01c54c
.RE
72b139
.PP
01c54c
\fBpre\-restore\fR
72b139
.RS 4
72b139
run prior to beginning a
01c54c
\fBrestore\fR
01c54c
.RE
72b139
.PP
72b139
\fBpre\-resume\fR
01c54c
.RS 4
72b139
run when all processes and resources are restored but tasks are stopped waiting for final kick to run\&. Must not fail\&.
72b139
.RE
72b139
.PP
01c54c
\fBpost\-restore\fR
72b139
.RS 4
72b139
run upon
01c54c
\fBrestore\fR
72b139
completion
01c54c
.RE
72b139
.PP
01c54c
\fBnetwork\-lock\fR
01c54c
.RS 4
72b139
run to lock network in a target network namespace
01c54c
.RE
72b139
.PP
72b139
\fBnetwork\-unlock\fR
01c54c
.RS 4
72b139
run to unlock network in a target network namespace
72b139
.RE
72b139
.PP
01c54c
\fBsetup\-namespaces\fR
72b139
.RS 4
72b139
run once root task just been created with required namespaces\&. Note it is an early stage of restore, when nothing is restored yet except for namespaces themselves
01c54c
.RE
01c54c
.RE
01c54c
.PP
01c54c
\fB\-V\fR, \fB\-\-version\fR
01c54c
.RS 4
01c54c
Print program version and exit\&.
01c54c
.RE
01c54c
.PP
01c54c
\fB\-h\fR, \fB\-\-help\fR
01c54c
.RS 4
72b139
Print some help and exit\&.
01c54c
.RE
01c54c
.SS "pre\-dump"
01c54c
.sp
72b139
Performs the pre\-dump procedure, during which \fBcriu\fR creates a snapshot of memory changes since the previous \fBpre\-dump\fR\&. Note that during this \fBcriu\fR also creates the fsnotify cache which speeds up the \fBrestore\fR procedure\&. \fBpre\-dump\fR requires at least \fB\-t\fR option (see \fBdump\fR below)\&. In addition, \fBpage\-server\fR options may be specified\&.
01c54c
.PP
01c54c
\fB\-\-track\-mem\fR
01c54c
.RS 4
01c54c
Turn on memory changes tracker in the kernel\&. If the option is not passed the memory tracker get turned on implicitly\&.
01c54c
.RE
01c54c
.SS "dump"
01c54c
.sp
72b139
Performs a checkpoint procedure\&.
01c54c
.PP
72b139
\fB\-t\fR, \fB\-\-tree\fR \fIpid\fR
01c54c
.RS 4
01c54c
Checkpoint the whole process tree starting from
72b139
\fIpid\fR\&.
01c54c
.RE
01c54c
.PP
01c54c
\fB\-R\fR, \fB\-\-leave\-running\fR
01c54c
.RS 4
72b139
Leave tasks in running state after checkpoint, instead of killing\&. This option is pretty dangerous and should be used only if you understand what you are doing\&.
01c54c
.sp
72b139
Note if task is about to run after been checkpointed, it can modify TCP connections, delete files and do other dangerous actions\&. Therefore,
01c54c
\fBcriu\fR
72b139
can not guarantee that the next
01c54c
\fBrestore\fR
72b139
action will succeed\&. Most likely if this option is used, at least the file system snapshot must be made with the help of
72b139
\fBpost\-dump\fR
72b139
action script\&.
01c54c
.sp
72b139
In other words, do not use it unless really needed\&.
01c54c
.RE
01c54c
.PP
01c54c
\fB\-s\fR, \fB\-\-leave\-stopped\fR
01c54c
.RS 4
72b139
Leave tasks in stopped state after checkpoint, instead of killing\&.
72b139
.RE
72b139
.PP
72b139
\fB\-\-external\fR \fItype\fR\fB[\fR\fIid\fR\fB]:\fR\fIvalue\fR
72b139
.RS 4
72b139
Dump an instance of an external resource\&. The generic syntax is
72b139
\fItype\fR
72b139
of resource, followed by resource
72b139
\fIid\fR
72b139
(enclosed in literal square brackets), and optional
72b139
\fIvalue\fR
72b139
(prepended by a literal semicolon)\&. The following resource types are currently supported:
72b139
\fBmnt\fR,
72b139
\fBdev\fR,
72b139
\fBfile\fR,
72b139
\fBtty\fR,
72b139
\fBunix\fR\&. Syntax depends on type\&. Note to restore external resources, either
72b139
\fB\-\-external\fR
72b139
or
72b139
\fB\-\-inherit\-fd\fR
72b139
is used, depending on resource type\&.
01c54c
.RE
01c54c
.PP
72b139
\fB\-\-external mnt[\fR\fImountpoint\fR\fB]:\fR\fIname\fR
01c54c
.RS 4
72b139
Dump an external bind mount referenced by
72b139
\fImountpoint\fR, saving it to image under the identifier
72b139
\fIname\fR\&.
72b139
.RE
72b139
.PP
72b139
\fB\-\-external mnt[]:\fR\fIflags\fR
72b139
.RS 4
72b139
Dump all external bind mounts, autodetecting those\&. Optional
72b139
\fIflags\fR
72b139
can contain
72b139
\fBm\fR
72b139
to also dump external master mounts,
72b139
\fBs\fR
72b139
to also dump external shared mounts (default behavior is to abort dumping if such mounts are found)\&. If
72b139
\fIflags\fR
72b139
are not provided, semicolon is optional\&.
72b139
.RE
72b139
.PP
72b139
\fB\-\-external dev[\fR\fImajor\fR\fB/\fR\fIminor\fR\fB]:\fR\fIname\fR
72b139
.RS 4
72b139
Allow to dump a mount namespace having a real block device mounted\&. A block device is identified by its
72b139
\fImajor\fR
72b139
and
72b139
\fIminor\fR
72b139
numbers, and
72b139
\fBcriu\fR
72b139
saves its information to image under the identifier
72b139
\fIname\fR\&.
72b139
.RE
72b139
.PP
72b139
\fB\-\-external file[\fR\fImnt_id\fR\fB:\fR\fIinode\fR\fB]\fR
72b139
.RS 4
72b139
Dump an external file, i\&.e\&. an opened file that is can not be resolved from the current mount namespace, which can not be dumped without using this option\&. The file is identified by
72b139
\fImnt_id\fR
72b139
(a field obtained from
72b139
\fB/proc/\fR\fIpid\fR\fB/fdinfo/\fR\fIN\fR) and
72b139
\fIinode\fR
72b139
(as returned by
72b139
\fBstat\fR(2))\&.
72b139
.RE
72b139
.PP
72b139
\fB\-\-external tty[\fR\fIrdev\fR\fB:\fR\fIdev\fR\fB]\fR
72b139
.RS 4
72b139
Dump an external TTY, identified by
72b139
\fBst_rdev\fR
72b139
and
72b139
\fBst_dev\fR
72b139
fields returned by
72b139
\fBstat\fR(2)\&.
72b139
.RE
72b139
.PP
72b139
\fB\-\-external unix[\fR\fIid\fR\fB]\fR
72b139
.RS 4
72b139
Tell
72b139
\fBcriu\fR
72b139
that one end of a pair of UNIX sockets (created by
72b139
\fBsocketpair\fR(2)) with
72b139
\fIid\fR
72b139
is OK to be disconnected\&.
01c54c
.RE
01c54c
.PP
01c54c
\fB\-\-freeze\-cgroup\fR
01c54c
.RS 4
01c54c
Use cgroup freezer to collect processes\&.
01c54c
.RE
01c54c
.PP
01c54c
\fB\-\-manage\-cgroups\fR
01c54c
.RS 4
72b139
Collect cgroups into the image thus they gonna be restored then\&. Without this option,
01c54c
\fBcriu\fR
01c54c
will not save cgroups configuration associated with a task\&.
01c54c
.RE
01c54c
.PP
72b139
\fB\-\-cgroup\-props\fR \fIspec\fR
72b139
.RS 4
72b139
Specify controllers and their properties to be saved into the image file\&.
72b139
\fBcriu\fR
72b139
predefines specifications for common controllers, but since the kernel can add new controllers and modify their properties, there should be a way to specify ones matched the kernel\&.
72b139
.sp
72b139
\fIspec\fR
72b139
argument describes the controller and properties specification in a simplified YAML form:
72b139
.sp
72b139
.if n \{\
72b139
.RS 4
72b139
.\}
72b139
.fam C
72b139
.ps -1
72b139
.nf
72b139
.BB lightgray
72b139
"c1":
72b139
 \- "strategy": "merge"
72b139
 \- "properties": ["a", "b"]
72b139
"c2":
72b139
 \- "strategy": "replace"
72b139
 \- "properties": ["c", "d"]
72b139
.EB lightgray
72b139
.fi
72b139
.fam
72b139
.ps +1
72b139
.if n \{\
72b139
.RE
72b139
.\}
72b139
.sp
72b139
where
72b139
\fIc1\fR
72b139
and
72b139
\fIc2\fR
72b139
are controllers names, and
72b139
\fIa\fR,
72b139
\fIb\fR,
72b139
\fIc\fR,
72b139
\fId\fR
72b139
are their properties\&.
72b139
.sp
72b139
Note the format: double quotes, spaces and new lines are required\&. The
72b139
\fIstrategy\fR
72b139
specifies what to do if a controller specified already exists as a built\-in one:
72b139
\fBcriu\fR
72b139
can either
72b139
\fBmerge\fR
72b139
or
72b139
\fBreplace\fR
72b139
such\&.
72b139
.sp
72b139
For example, the command line for the above example should look like this:
72b139
.sp
72b139
.if n \{\
72b139
.RS 4
72b139
.\}
72b139
.fam C
72b139
.ps -1
72b139
.nf
72b139
.BB lightgray
72b139
\-\-cgroup\-props "\e"c1\e":\en \- \e"strategy\e": \e"merge\e"\en \- \e"properties\e": [\e"a\e", \e"b\e"]\en \e"c2\e":\en \- \e"strategy\e": \e"replace\e"\en \- \e"properties\e": [\e"c\e", \e"d\e"]"
72b139
.EB lightgray
72b139
.fi
72b139
.fam
72b139
.ps +1
72b139
.if n \{\
72b139
.RE
72b139
.\}
72b139
.RE
72b139
.PP
72b139
\fB\-\-cgroup\-props\-file\fR \fIfile\fR
72b139
.RS 4
72b139
Same as
72b139
\fB\-\-cgroup\-props\fR, except the specification is read from the
72b139
\fIfile\fR\&.
72b139
.RE
72b139
.PP
72b139
\fB\-\-cgroup\-dump\-controller\fR \fIname\fR
72b139
.RS 4
72b139
Dump a controller with
72b139
\fIname\fR
72b139
only, skipping anything else that was discovered automatically (usually via
72b139
\fB/proc\fR)\&. This option is useful when one needs
72b139
\fBcriu\fR
72b139
to skip some controllers\&.
72b139
.RE
72b139
.PP
72b139
\fB\-\-cgroup\-props\-ignore\-default\fR
72b139
.RS 4
72b139
When combined with
72b139
\fB\-\-cgroup\-props\fR, makes
72b139
\fBcriu\fR
72b139
substitute a predefined controller property with the new one shipped\&. If the option is not used, the predefined properties are merged with the provided ones\&.
72b139
.RE
72b139
.PP
01c54c
\fB\-\-tcp\-established\fR
01c54c
.RS 4
01c54c
Checkpoint established TCP connections\&.
01c54c
.RE
01c54c
.PP
72b139
\fB\-\-skip\-in\-flight\fR
01c54c
.RS 4
72b139
This option skips in\-flight TCP connections\&. If any TCP connections that are not yet completely established are found,
72b139
\fBcriu\fR
72b139
ignores these connections, rather than errors out\&. The TCP stack on the client side is expected to handle the re\-connect gracefully\&.
01c54c
.RE
01c54c
.PP
01c54c
\fB\-\-evasive\-devices\fR
01c54c
.RS 4
01c54c
Use any path to a device file if the original one is inaccessible\&.
01c54c
.RE
01c54c
.PP
01c54c
\fB\-\-page\-server\fR
01c54c
.RS 4
72b139
Send pages to a page server (see the
01c54c
\fBpage\-server\fR
01c54c
command)\&.
01c54c
.RE
01c54c
.PP
01c54c
\fB\-\-force\-irmap\fR
01c54c
.RS 4
01c54c
Force resolving names for inotify and fsnotify watches\&.
01c54c
.RE
01c54c
.PP
01c54c
\fB\-\-auto\-dedup\fR
01c54c
.RS 4
01c54c
Deduplicate "old" data in pages images of previous
72b139
\fBdump\fR\&. This option implies incremental
01c54c
\fBdump\fR
72b139
mode (see the
01c54c
\fBpre\-dump\fR
01c54c
command)\&.
01c54c
.RE
01c54c
.PP
01c54c
\fB\-l\fR, \fB\-\-file\-locks\fR
01c54c
.RS 4
72b139
Dump file locks\&. It is necessary to make sure that all file lock users are taken into dump, so it is only safe to use this for enclosed containers where locks are not held by any processes outside of dumped process tree\&.
01c54c
.RE
01c54c
.PP
01c54c
\fB\-\-link\-remap\fR
01c54c
.RS 4
72b139
Allows to link unlinked files back, if possible (modifies filesystem during
01c54c
\fBrestore\fR)\&.
01c54c
.RE
01c54c
.PP
01c54c
\fB\-\-ghost\-limit\fR \fIsize\fR
01c54c
.RS 4
72b139
Set the maximum size of deleted file to be carried inside image\&. By default, up to 1M file is allowed\&. Using this option allows to not put big deleted files inside images\&. Argument
01c54c
\fIsize\fR
72b139
may be postfixed with a
72b139
\fBK\fR,
72b139
\fBM\fR
01c54c
or
72b139
\fBG\fR, which stands for kilo\-, mega, and gigabytes, accordingly\&.
01c54c
.RE
01c54c
.PP
01c54c
\fB\-j\fR, \fB\-\-shell\-job\fR
01c54c
.RS 4
72b139
Allow one to dump shell jobs\&. This implies the restored task will inherit session and process group ID from the
72b139
\fBcriu\fR
72b139
itself\&. This option also allows to migrate a single external tty connection, to migrate applications like
72b139
\fBtop\fR\&. If used with
01c54c
\fBdump\fR
72b139
command, it must be specified with
01c54c
\fBrestore\fR
01c54c
as well\&.
01c54c
.RE
01c54c
.PP
72b139
\fB\-\-cpu\-cap\fR [\fIcap\fR[,\fIcap\fR\&...]]
01c54c
.RS 4
72b139
Specify CPU capabilities to write to an image file\&. The argument is a comma\-separated list of
72b139
\fBnone\fR,
72b139
\fBfpu\fR,
72b139
\fBcpu\fR,
72b139
\fBins\fR,
72b139
\fBall\fR\&. If the argument is omitted or set to
72b139
\fBnone\fR, capabilities will not be written, which is the default behavior\&.
01c54c
.RE
01c54c
.PP
72b139
\fB\-\-cgroup\-root\fR [\fIcontroller\fR:]/\fInewroot\fR
01c54c
.RS 4
72b139
Change the root for the controller that will be dumped\&. By default,
01c54c
\fBcriu\fR
72b139
simply dumps everything below where any of the tasks live\&. However, if a container moves all of its tasks into a cgroup directory below the container engine\(cqs default directory for tasks, permissions will not be preserved on the upper directories with no tasks in them, which may cause problems\&.
01c54c
.RE
72b139
.SS "restore"
72b139
.sp
72b139
Restores previously checkpointed processes\&.
01c54c
.PP
72b139
\fB\-\-inherit\-fd\fR \fBfd[\fR\fIN\fR\fB]:\fR\fIresource\fR
01c54c
.RS 4
72b139
Inherit a file descriptor\&. This option lets
01c54c
\fBcriu\fR
72b139
use an already opened file descriptor
72b139
\fIN\fR
72b139
for restoring a file identified by
72b139
\fIresource\fR\&. This option can be used to restore an external resource dumped with the help of
72b139
\fB\-\-external\fR
72b139
\fBfile\fR,
72b139
\fBtty\fR, and
72b139
\fBunix\fR
72b139
options\&.
01c54c
.sp
01c54c
The
72b139
\fIresource\fR
72b139
argument can be one of the following:
01c54c
.sp
01c54c
.RS 4
01c54c
.ie n \{\
01c54c
\h'-04'\(bu\h'+03'\c
01c54c
.\}
01c54c
.el \{\
01c54c
.sp -1
01c54c
.IP \(bu 2.3
01c54c
.\}
72b139
\fBtty[\fR\fIrdev\fR\fB:\fR\fIdev\fR\fB]\fR
01c54c
.RE
01c54c
.sp
01c54c
.RS 4
01c54c
.ie n \{\
01c54c
\h'-04'\(bu\h'+03'\c
01c54c
.\}
01c54c
.el \{\
01c54c
.sp -1
01c54c
.IP \(bu 2.3
01c54c
.\}
72b139
\fBpipe[\fR\fIinode\fR\fB]\fR
01c54c
.RE
01c54c
.sp
01c54c
.RS 4
01c54c
.ie n \{\
01c54c
\h'-04'\(bu\h'+03'\c
01c54c
.\}
01c54c
.el \{\
01c54c
.sp -1
01c54c
.IP \(bu 2.3
01c54c
.\}
72b139
\fBsocket[\fR\fIinode\fR\fB]\fR
01c54c
.RE
01c54c
.sp
01c54c
.RS 4
01c54c
.ie n \{\
01c54c
\h'-04'\(bu\h'+03'\c
01c54c
.\}
01c54c
.el \{\
01c54c
.sp -1
01c54c
.IP \(bu 2.3
01c54c
.\}
72b139
\fBfile[\fR\fImnt_id\fR\fB:\fR\fIinode\fR\fB]\fR
01c54c
.RE
01c54c
.sp
01c54c
.RS 4
01c54c
.ie n \{\
01c54c
\h'-04'\(bu\h'+03'\c
01c54c
.\}
01c54c
.el \{\
01c54c
.sp -1
01c54c
.IP \(bu 2.3
01c54c
.\}
72b139
\fIpath/to/file\fR
01c54c
.RE
72b139
.sp
72b139
Note that square brackets used in this option arguments are literals and usually need to be escaped from shell\&.
01c54c
.RE
01c54c
.PP
72b139
\fB\-d\fR, \fB\-\-restore\-detached\fR
01c54c
.RS 4
72b139
Detach
72b139
\fBcriu\fR
72b139
itself once restore is complete\&.
01c54c
.RE
01c54c
.PP
72b139
\fB\-s\fR, \fB\-\-leave\-stopped\fR
01c54c
.RS 4
72b139
Leave tasks in stopped state after restore (rather than resuming their execution)\&.
72b139
.RE
72b139
.PP
72b139
\fB\-S\fR, \fB\-\-restore\-sibling\fR
72b139
.RS 4
72b139
Restore root task as a sibling (makes sense only with
72b139
\fB\-\-restore\-detached\fR)\&.
72b139
.RE
72b139
.PP
72b139
\fB\-r\fR, \fB\-\-root\fR \fIpath\fR
72b139
.RS 4
72b139
Change the root filesystem to
72b139
\fIpath\fR
72b139
(when run in a mount namespace)\&.
72b139
.RE
72b139
.PP
72b139
\fB\-\-external\fR \fItype\fR\fB[\fR\fIid\fR\fB]:\fR\fIvalue\fR
72b139
.RS 4
72b139
Restore an instance of an external resource\&. The generic syntax is
72b139
\fItype\fR
72b139
of resource, followed by resource
72b139
\fIid\fR
72b139
(enclosed in literal square brackets), and optional
72b139
\fIvalue\fR
72b139
(prepended by a literal semicolon)\&. The following resource types are currently supported:
72b139
\fBmnt\fR,
72b139
\fBdev\fR,
72b139
\fBveth\fR,
72b139
\fBmacvlan\fR\&. Syntax depends on type\&. Note to restore external resources dealing with opened file descriptors (such as dumped with the help of
72b139
\fB\-\-external\fR
72b139
\fBfile\fR,
72b139
\fBtty\fR, and
72b139
\fBunix\fR
72b139
options), option
72b139
\fB\-\-inherit\-fd\fR
72b139
should be used\&.
72b139
.RE
72b139
.PP
72b139
\fB\-\-external mnt[\fR\fIname\fR\fB]:\fR\fImountpoint\fR
72b139
.RS 4
72b139
Restore an external bind mount referenced in the image by
72b139
\fIname\fR, bind\-mounting it from the host
72b139
\fImountpoint\fR
72b139
to a proper mount point\&.
72b139
.RE
72b139
.PP
72b139
\fB\-\-external mnt[]\fR
72b139
.RS 4
72b139
Restore all external bind mounts (dumped with the help of
72b139
\fB\-\-external mnt[]\fR
72b139
auto\-detection)\&.
72b139
.RE
72b139
.PP
72b139
\fB\-\-external dev[\fR\fIname\fR\fB]:\fR\fI/dev/path\fR
72b139
.RS 4
72b139
Restore an external mount device, identified in the image by
72b139
\fIname\fR, using the existing block device
72b139
\fI/dev/path\fR\&.
72b139
.RE
72b139
.PP
72b139
\fB\-\-external veth[\fR\fIinner_dev\fR\fB]:\fR\fIouter_dev\fR\fB@\fR\fIbridge\fR
72b139
.RS 4
72b139
Set the outer VETH device name (corresponding to
72b139
\fIinner_dev\fR
72b139
being restored) to
72b139
\fIouter_dev\fR\&. If optional
72b139
\fB@\fR\fIbridge\fR
72b139
is specified,
72b139
\fIouter_dev\fR
72b139
is added to that bridge\&. If the option is not used,
72b139
\fIouter_dev\fR
72b139
will be autogenerated by the kernel\&.
72b139
.RE
72b139
.PP
72b139
\fB\-\-external macvlan[\fR\fIinner_dev\fR\fB]:\fR\fIouter_dev\fR
72b139
.RS 4
72b139
When restoring an image that have a MacVLAN device in it, this option must be used to specify to which
72b139
\fIouter_dev\fR
72b139
(an existing network device in CRIU namespace) the restored
72b139
\fIinner_dev\fR
72b139
should be bound to\&.
72b139
.RE
72b139
.PP
72b139
\fB\-\-manage\-cgroups\fR [\fImode\fR]
72b139
.RS 4
72b139
Restore cgroups configuration associated with a task from the image\&. Controllers are always restored in an optimistic way \(em if already present in system,
72b139
\fBcriu\fR
72b139
reuses it, otherwise it will be created\&.
72b139
.RE
72b139
.sp
72b139
The \fImode\fR may be one of the following:
72b139
.PP
72b139
\fBnone\fR
72b139
.RS 4
72b139
Do not restore cgroup properties but require cgroup to pre\-exist at the moment of
01c54c
\fBrestore\fR
72b139
procedure\&.
01c54c
.RE
01c54c
.PP
72b139
\fBprops\fR
01c54c
.RS 4
72b139
Restore cgroup properties and require cgroup to pre\-exist\&.
01c54c
.RE
01c54c
.PP
72b139
\fBsoft\fR
01c54c
.RS 4
72b139
Restore cgroup properties if only cgroup has been created by
72b139
\fBcriu\fR, otherwise do not restore properties\&. This is the default if mode is unspecified\&.
01c54c
.RE
01c54c
.PP
72b139
\fBfull\fR
01c54c
.RS 4
72b139
Always restore all cgroups and their properties\&.
01c54c
.RE
01c54c
.PP
72b139
\fBstrict\fR
01c54c
.RS 4
72b139
Restore all cgroups and their properties from the scratch, requiring them to not present in the system\&.
72b139
.PP
72b139
\fB\-\-cgroup\-root\fR [\fIcontroller\fR\fB:\fR]/\fInewroot\fR
72b139
.RS 4
72b139
Change the root cgroup the controller will be installed into\&. No controller means that root is the default for all controllers not specified\&.
72b139
.RE
72b139
.PP
72b139
\fB\-\-tcp\-established\fR
72b139
.RS 4
72b139
Restore previously dumped established TCP connections\&. This implies that the network has been locked between
72b139
\fBdump\fR
72b139
and
72b139
\fBrestore\fR
72b139
phases so other side of a connection simply notice a kind of lag\&.
72b139
.RE
72b139
.PP
72b139
\fB\-\-veth\-pair\fR \fIIN\fR\fB=\fR\fIOUT\fR
72b139
.RS 4
72b139
Correspondence between outside and inside names of veth devices\&.
01c54c
.RE
01c54c
.PP
72b139
\fB\-l\fR, \fB\-\-file\-locks\fR
01c54c
.RS 4
72b139
Restore file locks from the image\&.
01c54c
.RE
01c54c
.PP
01c54c
\fB\-\-auto\-dedup\fR
01c54c
.RS 4
01c54c
As soon as a page is restored it get punched out from image\&.
01c54c
.RE
01c54c
.PP
01c54c
\fB\-j\fR, \fB\-\-shell\-job\fR
01c54c
.RS 4
01c54c
Restore shell jobs, in other words inherit session and process group ID from the criu itself\&.
01c54c
.RE
01c54c
.PP
72b139
\fB\-\-cpu\-cap\fR [\fIcap\fR[,\fIcap\fR\&...]]
01c54c
.RS 4
72b139
Specify CPU capabilities to be present on the CPU the process is restoring\&. To inverse a capability, prefix it with
01c54c
\fB^\fR\&. This option implies that
01c54c
\fB\-\-cpu\-cap\fR
01c54c
has been passed on
01c54c
\fBdump\fR
01c54c
as well, except
01c54c
\fBfpu\fR
72b139
option case\&. The
72b139
\fIcap\fR
72b139
argument can be the following (or a set of comma\-separated values):
72b139
.RE
72b139
.RE
72b139
.PP
72b139
\fBall\fR
01c54c
.RS 4
72b139
Require all capabilities\&. This is
01c54c
\fBdefault\fR
01c54c
mode if
01c54c
\fB\-\-cpu\-cap\fR
01c54c
is passed without arguments\&. Most safe mode\&.
01c54c
.RE
72b139
.PP
72b139
\fBcpu\fR
01c54c
.RS 4
72b139
Require the CPU to have all capabilities in image to match runtime CPU\&.
01c54c
.RE
72b139
.PP
72b139
\fBfpu\fR
01c54c
.RS 4
72b139
Require the CPU to have compatible FPU\&. For example the process might be dumped with xsave capability but attempted to restore without it present on target CPU\&. In such case we refuse to proceed\&. This is
01c54c
\fBdefault\fR
01c54c
mode if
01c54c
\fB\-\-cpu\-cap\fR
01c54c
is not present in command line\&. Note this argument might be passed even if on the
01c54c
\fBdump\fR
01c54c
no
01c54c
\fB\-\-cpu\-cap\fR
72b139
have been specified because FPU frames are always encoded into images\&.
01c54c
.RE
72b139
.PP
72b139
\fBins\fR
01c54c
.RS 4
72b139
Require CPU compatibility on instructions level\&.
01c54c
.RE
72b139
.PP
72b139
\fBnone\fR
01c54c
.RS 4
72b139
Ignore capabilities\&. Most dangerous mode\&. The behaviour is implementation dependent\&. Try to not use it until really required\&.
01c54c
.sp
72b139
For example, this option can be used in case
72b139
\fB\-\-cpu\-cap=cpu\fR
72b139
was used during
72b139
\fBdump\fR, and images are migrated to a less capable CPU and are to be restored\&. By default,
01c54c
\fBcriu\fR
72b139
shows an error that CPU capabilities are not adequate, but this can be suppressed by using
72b139
\fB\-\-cpu\-cap=none\fR\&.
72b139
.PP
72b139
\fB\-\-weak\-sysctls\fR
72b139
.RS 4
72b139
Silently skip restoring sysctls that are not available\&. This allows to restore on an older kernel, or a kernel configured without some options\&.
01c54c
.RE
01c54c
.RE
01c54c
.SS "check"
01c54c
.sp
72b139
Checks whether the kernel supports the features needed by \fBcriu\fR to dump and restore a process tree\&.
01c54c
.sp
72b139
There are three categories of kernel support, as described below\&. \fBcriu check\fR always checks Category 1 features unless \fB\-\-feature\fR is specified which only checks a specified feature\&.
72b139
.PP
72b139
\fBCategory 1\fR
01c54c
.RS 4
72b139
Absolutely required\&. These are features like support for
72b139
\fB/proc/PID/map_files\fR,
72b139
\fBNETLINK_SOCK_DIAG\fR
01c54c
socket monitoring,
72b139
\fB/proc/sys/kernel/ns_last_pid\fR
72b139
etc\&.
01c54c
.RE
72b139
.PP
72b139
\fBCategory 2\fR
01c54c
.RS 4
72b139
Required only for specific cases\&. These are features like AIO remap,
72b139
\fB/dev/net/tun\fR
72b139
and others that are only required if a process being dumped or restored is using those\&.
01c54c
.RE
72b139
.PP
72b139
\fBCategory 3\fR
01c54c
.RS 4
72b139
Experimental\&. These are features like
72b139
\fBtask\-diag\fR
72b139
that are used for experimental purposes (mostly during development)\&.
01c54c
.RE
01c54c
.sp
72b139
If there are no errors or warnings, \fBcriu\fR prints "Looks good\&." and its exit code is 0\&.
01c54c
.sp
72b139
A missing Category 1 feature causes \fBcriu\fR to print "Does not look good\&." and its exit code is non\-zero\&.
01c54c
.sp
72b139
Missing Category 2 and 3 features cause \fBcriu\fR to print "Looks good but \&..." and its exit code is be non\-zero\&.
01c54c
.sp
72b139
Without any options, \fBcriu check\fR checks Category 1 features\&. This behavior can be changed by using the following options:
01c54c
.PP
01c54c
\fB\-\-extra\fR
01c54c
.RS 4
01c54c
Check kernel support for Category 2 features\&.
01c54c
.RE
01c54c
.PP
01c54c
\fB\-\-experimental\fR
01c54c
.RS 4
01c54c
Check kernel support for Category 3 features\&.
01c54c
.RE
01c54c
.PP
01c54c
\fB\-\-all\fR
01c54c
.RS 4
01c54c
Check kernel support for Category 1, 2, and 3 features\&.
01c54c
.RE
01c54c
.PP
72b139
\fB\-\-feature\fR \fIname\fR
01c54c
.RS 4
01c54c
Check a specific feature\&. If
72b139
\fIname\fR
01c54c
is
72b139
\fBlist\fR, a list of valid kernel feature names that can be checked will be printed\&.
01c54c
.RE
01c54c
.SS "page\-server"
01c54c
.sp
01c54c
Launches \fBcriu\fR in page server mode\&.
01c54c
.PP
01c54c
\fB\-\-daemon\fR
01c54c
.RS 4
01c54c
Runs page server as a daemon (background process)\&.
01c54c
.RE
01c54c
.PP
72b139
\fB\-\-status_fd\fR
72b139
.RS 4
72b139
Write \e\e0 to the FD and close it once page\-server is ready to handle requests\&. The status\-fd allows to not daemonize a process and get its exit code at the end\&. It isn\(cqt supposed to use \-\-daemon and \-\-status\-fd together\&.
72b139
.RE
72b139
.PP
72b139
\fB\-\-address\fR \fIaddress\fR
01c54c
.RS 4
01c54c
Page server IP address\&.
01c54c
.RE
01c54c
.PP
72b139
\fB\-\-port\fR \fInumber\fR
01c54c
.RS 4
01c54c
Page server port number\&.
01c54c
.RE
01c54c
.SS "exec"
01c54c
.sp
72b139
Executes a system call inside a destination task\*(Aqs context\&. This functionality is deprecated; please use \fBCompel\fR instead\&.
01c54c
.SS "service"
01c54c
.sp
72b139
Launches \fBcriu\fR in RPC daemon mode, where \fBcriu\fR is listening for RPC commands over socket to perform\&. This is convenient for a case where daemon itself is running in a privileged (superuser) mode but clients are not\&.
01c54c
.SS "dedup"
01c54c
.sp
72b139
Starts pagemap data deduplication procedure, where \fBcriu\fR scans over all pagemap files and tries to minimize the number of pagemap entries by obtaining the references from a parent pagemap image\&.
01c54c
.SS "cpuinfo dump"
01c54c
.sp
01c54c
Fetches current CPU features and write them into an image file\&.
01c54c
.SS "cpuinfo check"
01c54c
.sp
72b139
Fetches current CPU features (i\&.e\&. CPU the \fBcriu\fR is running on) and test if they are compatible with the ones present in an image file\&.
01c54c
.SH "EXAMPLES"
01c54c
.sp
01c54c
To checkpoint a program with pid of \fB1234\fR and write all image files into directory \fBcheckpoint\fR:
01c54c
.sp
01c54c
.if n \{\
01c54c
.RS 4
01c54c
.\}
72b139
.fam C
72b139
.ps -1
01c54c
.nf
72b139
.BB lightgray
01c54c
    criu dump \-D checkpoint \-t 1234
72b139
.EB lightgray
01c54c
.fi
72b139
.fam
72b139
.ps +1
01c54c
.if n \{\
01c54c
.RE
01c54c
.\}
01c54c
.sp
01c54c
To restore this program detaching criu itself:
01c54c
.sp
01c54c
.if n \{\
01c54c
.RS 4
01c54c
.\}
72b139
.fam C
72b139
.ps -1
01c54c
.nf
72b139
.BB lightgray
01c54c
    criu restore \-d \-D checkpoint
72b139
.EB lightgray
01c54c
.fi
72b139
.fam
72b139
.ps +1
01c54c
.if n \{\
01c54c
.RE
01c54c
.\}
01c54c
.SH "AUTHOR"
01c54c
.sp
72b139
The CRIU team\&.
01c54c
.SH "COPYRIGHT"
01c54c
.sp
72b139
Copyright (C) 2011\-2016, Parallels Holdings, Inc\&.