703fec
'\" t
703fec
.\"     Title: criu
703fec
.\"    Author: [see the "AUTHOR" section]
703fec
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
703fec
.\"      Date: 04/23/2019
703fec
.\"    Manual: CRIU Manual
703fec
.\"    Source: criu 3.12
703fec
.\"  Language: English
703fec
.\"
703fec
.TH "CRIU" "8" "04/23/2019" "criu 3\&.12" "CRIU Manual"
703fec
.\" -----------------------------------------------------------------
703fec
.\" * Define some portability stuff
703fec
.\" -----------------------------------------------------------------
703fec
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
703fec
.\" http://bugs.debian.org/507673
703fec
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
703fec
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
703fec
.ie \n(.g .ds Aq \(aq
703fec
.el       .ds Aq '
703fec
.\" -----------------------------------------------------------------
703fec
.\" * (re)Define some macros
703fec
.\" -----------------------------------------------------------------
703fec
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
703fec
.\" toupper - uppercase a string (locale-aware)
703fec
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
703fec
.de toupper
703fec
.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
703fec
\\$*
703fec
.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
703fec
..
703fec
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
703fec
.\" SH-xref - format a cross-reference to an SH section
703fec
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
703fec
.de SH-xref
703fec
.ie n \{\
703fec
.\}
703fec
.toupper \\$*
703fec
.el \{\
703fec
\\$*
703fec
.\}
703fec
..
703fec
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
703fec
.\" SH - level-one heading that works better for non-TTY output
703fec
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
703fec
.de1 SH
703fec
.\" put an extra blank line of space above the head in non-TTY output
703fec
.if t \{\
703fec
.sp 1
703fec
.\}
703fec
.sp \\n[PD]u
703fec
.nr an-level 1
703fec
.set-an-margin
703fec
.nr an-prevailing-indent \\n[IN]
703fec
.fi
703fec
.in \\n[an-margin]u
703fec
.ti 0
703fec
.HTML-TAG ".NH \\n[an-level]"
703fec
.it 1 an-trap
703fec
.nr an-no-space-flag 1
703fec
.nr an-break-flag 1
703fec
\." make the size of the head bigger
703fec
.ps +3
703fec
.ft B
703fec
.ne (2v + 1u)
703fec
.ie n \{\
703fec
.\" if n (TTY output), use uppercase
703fec
.toupper \\$*
703fec
.\}
703fec
.el \{\
703fec
.nr an-break-flag 0
703fec
.\" if not n (not TTY), use normal case (not uppercase)
703fec
\\$1
703fec
.in \\n[an-margin]u
703fec
.ti 0
703fec
.\" if not n (not TTY), put a border/line under subheading
703fec
.sp -.6
703fec
\l'\n(.lu'
703fec
.\}
703fec
..
703fec
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
703fec
.\" SS - level-two heading that works better for non-TTY output
703fec
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
703fec
.de1 SS
703fec
.sp \\n[PD]u
703fec
.nr an-level 1
703fec
.set-an-margin
703fec
.nr an-prevailing-indent \\n[IN]
703fec
.fi
703fec
.in \\n[IN]u
703fec
.ti \\n[SN]u
703fec
.it 1 an-trap
703fec
.nr an-no-space-flag 1
703fec
.nr an-break-flag 1
703fec
.ps \\n[PS-SS]u
703fec
\." make the size of the head bigger
703fec
.ps +2
703fec
.ft B
703fec
.ne (2v + 1u)
703fec
.if \\n[.$] \&\\$*
703fec
..
703fec
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
703fec
.\" BB/EB - put background/screen (filled box) around block of text
703fec
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
703fec
.de BB
703fec
.if t \{\
703fec
.sp -.5
703fec
.br
703fec
.in +2n
703fec
.ll -2n
703fec
.gcolor red
703fec
.di BX
703fec
.\}
703fec
..
703fec
.de EB
703fec
.if t \{\
703fec
.if "\\$2"adjust-for-leading-newline" \{\
703fec
.sp -1
703fec
.\}
703fec
.br
703fec
.di
703fec
.in
703fec
.ll
703fec
.gcolor
703fec
.nr BW \\n(.lu-\\n(.i
703fec
.nr BH \\n(dn+.5v
703fec
.ne \\n(BHu+.5v
703fec
.ie "\\$2"adjust-for-leading-newline" \{\
703fec
\M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
703fec
.\}
703fec
.el \{\
703fec
\M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[]
703fec
.\}
703fec
.in 0
703fec
.sp -.5v
703fec
.nf
703fec
.BX
703fec
.in
703fec
.sp .5v
703fec
.fi
703fec
.\}
703fec
..
703fec
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
703fec
.\" BM/EM - put colored marker in margin next to block of text
703fec
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
703fec
.de BM
703fec
.if t \{\
703fec
.br
703fec
.ll -2n
703fec
.gcolor red
703fec
.di BX
703fec
.\}
703fec
..
703fec
.de EM
703fec
.if t \{\
703fec
.br
703fec
.di
703fec
.ll
703fec
.gcolor
703fec
.nr BH \\n(dn
703fec
.ne \\n(BHu
703fec
\M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[]
703fec
.in 0
703fec
.nf
703fec
.BX
703fec
.in
703fec
.fi
703fec
.\}
703fec
..
703fec
.\" -----------------------------------------------------------------
703fec
.\" * set default formatting
703fec
.\" -----------------------------------------------------------------
703fec
.\" -----------------------------------------------------------------
703fec
.\" * MAIN CONTENT STARTS HERE *
703fec
.\" -----------------------------------------------------------------
703fec
.SH "Name"
703fec
criu \- checkpoint/restore in userspace
703fec
.SH "Synopsis"
703fec
.sp
703fec
\fBcriu\fR \fIcommand\fR [\fIoption\fR \&...]
703fec
.SH "DESCRIPTION"
703fec
.sp
703fec
\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\&.
703fec
.SH "OPTIONS"
703fec
.sp
703fec
Most of the true / false long options (the ones without arguments) can be prefixed with \fB\-\-no\-\fR to negate the option (example: \fB\-\-display\-stats\fR and \fB\-\-no\-display\-stats\fR)\&.
703fec
.SS "Common options"
703fec
.sp
703fec
Common options are applicable to any \fIcommand\fR\&.
703fec
.PP
703fec
\fB\-v\fR[\fBv\fR\&...], \fB\-\-verbosity\fR
703fec
.RS 4
703fec
Increase verbosity up from the default level\&. Multiple
703fec
\fBv\fR
703fec
can be used, each increasing verbosity by one level\&. Using long option without argument increases verbosity by one level\&.
703fec
.RE
703fec
.PP
703fec
\fB\-v\fR\fInum\fR, \fB\-\-verbosity\fR=\fInum\fR
703fec
.RS 4
703fec
Set verbosity level to
703fec
\fInum\fR\&. The higher the level, the more output is produced\&.
703fec
703fec
The following levels are available:
703fec
.sp
703fec
.RS 4
703fec
.ie n \{\
703fec
\h'-04'\(bu\h'+03'\c
703fec
.\}
703fec
.el \{\
703fec
.sp -1
703fec
.IP \(bu 2.3
703fec
.\}
703fec
\fB\-v0\fR
703fec
no output;
703fec
.RE
703fec
.sp
703fec
.RS 4
703fec
.ie n \{\
703fec
\h'-04'\(bu\h'+03'\c
703fec
.\}
703fec
.el \{\
703fec
.sp -1
703fec
.IP \(bu 2.3
703fec
.\}
703fec
\fB\-v1\fR
703fec
only errors;
703fec
.RE
703fec
.sp
703fec
.RS 4
703fec
.ie n \{\
703fec
\h'-04'\(bu\h'+03'\c
703fec
.\}
703fec
.el \{\
703fec
.sp -1
703fec
.IP \(bu 2.3
703fec
.\}
703fec
\fB\-v2\fR
703fec
above plus warnings (this is the default level);
703fec
.RE
703fec
.sp
703fec
.RS 4
703fec
.ie n \{\
703fec
\h'-04'\(bu\h'+03'\c
703fec
.\}
703fec
.el \{\
703fec
.sp -1
703fec
.IP \(bu 2.3
703fec
.\}
703fec
\fB\-v3\fR
703fec
above plus information messages and timestamps;
703fec
.RE
703fec
.sp
703fec
.RS 4
703fec
.ie n \{\
703fec
\h'-04'\(bu\h'+03'\c
703fec
.\}
703fec
.el \{\
703fec
.sp -1
703fec
.IP \(bu 2.3
703fec
.\}
703fec
\fB\-v4\fR
703fec
above plus lots of debug\&.
703fec
.RE
703fec
.RE
703fec
.PP
703fec
\fB\-\-config\fR \fIfile\fR
703fec
.RS 4
703fec
Pass a specific configuration file to criu\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-no\-default\-config\fR
703fec
.RS 4
703fec
Forbid parsing of default configuration files\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-pidfile\fR \fIfile\fR
703fec
.RS 4
703fec
Write root task, service or page\-server pid into a
703fec
\fIfile\fR\&.
703fec
.RE
703fec
.PP
703fec
\fB\-o\fR, \fB\-\-log\-file\fR \fIfile\fR
703fec
.RS 4
703fec
Write logging messages to
703fec
\fIfile\fR\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-display\-stats\fR
703fec
.RS 4
703fec
During dump as well as during restore
703fec
\fBcriu\fR
703fec
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
703fec
\fIstats\-dump\fR
703fec
and
703fec
\fIstats\-restore\fR
703fec
and can be easily displayed using
703fec
\fBcrit\fR\&. The option
703fec
\fB\-\-display\-stats\fR
703fec
additionally prints out this information on the console at the end of a dump or a restore\&.
703fec
.RE
703fec
.PP
703fec
\fB\-D\fR, \fB\-\-images\-dir\fR \fIpath\fR
703fec
.RS 4
703fec
Use
703fec
\fIpath\fR
703fec
as a base directory where to look for sets of image files\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-prev\-images\-dir\fR \fIpath\fR
703fec
.RS 4
703fec
Use
703fec
\fIpath\fR
703fec
as a parent directory where to look for sets of image files\&. This option makes sense in case of incremental dumps\&.
703fec
.RE
703fec
.PP
703fec
\fB\-W\fR, \fB\-\-work\-dir\fR \fIdir\fR
703fec
.RS 4
703fec
Use directory
703fec
\fIdir\fR
703fec
for putting logs, pidfiles and statistics\&. If not specified,
703fec
\fIpath\fR
703fec
from
703fec
\fB\-D\fR
703fec
option is taken\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-close\fR \fIfd\fR
703fec
.RS 4
703fec
Close file descriptor
703fec
\fIfd\fR
703fec
before performing any actions\&.
703fec
.RE
703fec
.PP
703fec
\fB\-L\fR, \fB\-\-libdir\fR \fIpath\fR
703fec
.RS 4
703fec
Path to plugins directory\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-action\-script\fR \fIscript\fR
703fec
.RS 4
703fec
Add an external action script to be executed at certain stages\&. The environment variable
703fec
\fBCRTOOLS_SCRIPT_ACTION\fR
703fec
is available to the script to find out which action is being executed, and its value can be one of the following:
703fec
.PP
703fec
\fBpre\-dump\fR
703fec
.RS 4
703fec
run prior to beginning a
703fec
\fBdump\fR
703fec
.RE
703fec
.PP
703fec
\fBpost\-dump\fR
703fec
.RS 4
703fec
run upon
703fec
\fBdump\fR
703fec
completion
703fec
.RE
703fec
.PP
703fec
\fBpre\-restore\fR
703fec
.RS 4
703fec
run prior to beginning a
703fec
\fBrestore\fR
703fec
.RE
703fec
.PP
703fec
\fBpost\-restore\fR
703fec
.RS 4
703fec
run upon
703fec
\fBrestore\fR
703fec
completion
703fec
.RE
703fec
.PP
703fec
\fBpre\-resume\fR
703fec
.RS 4
703fec
run when all processes and resources are restored but tasks are stopped waiting for final kick to run\&. Must not fail\&.
703fec
.RE
703fec
.PP
703fec
\fBpost\-resume\fR
703fec
.RS 4
703fec
called at the very end, when everything is restored and processes were resumed
703fec
.RE
703fec
.PP
703fec
\fBnetwork\-lock\fR
703fec
.RS 4
703fec
run to lock network in a target network namespace
703fec
.RE
703fec
.PP
703fec
\fBnetwork\-unlock\fR
703fec
.RS 4
703fec
run to unlock network in a target network namespace
703fec
.RE
703fec
.PP
703fec
\fBsetup\-namespaces\fR
703fec
.RS 4
703fec
run once root task has just been created with required namespaces\&. Note it is an early stage of restore, when nothing is restored yet, except for namespaces themselves
703fec
.RE
703fec
.PP
703fec
\fBpost\-setup\-namespaces\fR
703fec
.RS 4
703fec
called after the namespaces are configured
703fec
.RE
703fec
.PP
703fec
\fBorphan\-pts\-master\fR
703fec
.RS 4
703fec
called after master pty is opened and unlocked\&. This hook can be used only in the RPC mode, and the notification message contains a file descriptor for the master pty
703fec
.RE
703fec
.RE
703fec
.PP
703fec
\fB\-V\fR, \fB\-\-version\fR
703fec
.RS 4
703fec
Print program version and exit\&.
703fec
.RE
703fec
.PP
703fec
\fB\-h\fR, \fB\-\-help\fR
703fec
.RS 4
703fec
Print some help and exit\&.
703fec
.RE
703fec
.SS "pre\-dump"
703fec
.sp
703fec
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\&.
703fec
.PP
703fec
\fB\-\-track\-mem\fR
703fec
.RS 4
703fec
Turn on memory changes tracker in the kernel\&. If the option is not passed the memory tracker get turned on implicitly\&.
703fec
.RE
703fec
.SS "dump"
703fec
.sp
703fec
Performs a checkpoint procedure\&.
703fec
.PP
703fec
\fB\-t\fR, \fB\-\-tree\fR \fIpid\fR
703fec
.RS 4
703fec
Checkpoint the whole process tree starting from
703fec
\fIpid\fR\&.
703fec
.RE
703fec
.PP
703fec
\fB\-R\fR, \fB\-\-leave\-running\fR
703fec
.RS 4
703fec
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\&.
703fec
.sp
703fec
Note if task is about to run after been checkpointed, it can modify TCP connections, delete files and do other dangerous actions\&. Therefore,
703fec
\fBcriu\fR
703fec
can not guarantee that the next
703fec
\fBrestore\fR
703fec
action will succeed\&. Most likely if this option is used, at least the file system snapshot must be made with the help of
703fec
\fBpost\-dump\fR
703fec
action script\&.
703fec
.sp
703fec
In other words, do not use it unless really needed\&.
703fec
.RE
703fec
.PP
703fec
\fB\-s\fR, \fB\-\-leave\-stopped\fR
703fec
.RS 4
703fec
Leave tasks in stopped state after checkpoint, instead of killing\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-external\fR \fItype\fR\fB[\fR\fIid\fR\fB]:\fR\fIvalue\fR
703fec
.RS 4
703fec
Dump an instance of an external resource\&. The generic syntax is
703fec
\fItype\fR
703fec
of resource, followed by resource
703fec
\fIid\fR
703fec
(enclosed in literal square brackets), and optional
703fec
\fIvalue\fR
703fec
(prepended by a literal colon)\&. The following resource types are currently supported:
703fec
\fBmnt\fR,
703fec
\fBdev\fR,
703fec
\fBfile\fR,
703fec
\fBtty\fR,
703fec
\fBunix\fR\&. Syntax depends on type\&. Note to restore external resources, either
703fec
\fB\-\-external\fR
703fec
or
703fec
\fB\-\-inherit\-fd\fR
703fec
is used, depending on resource type\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-external mnt[\fR\fImountpoint\fR\fB]:\fR\fIname\fR
703fec
.RS 4
703fec
Dump an external bind mount referenced by
703fec
\fImountpoint\fR, saving it to image under the identifier
703fec
\fIname\fR\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-external mnt[]:\fR\fIflags\fR
703fec
.RS 4
703fec
Dump all external bind mounts, autodetecting those\&. Optional
703fec
\fIflags\fR
703fec
can contain
703fec
\fBm\fR
703fec
to also dump external master mounts,
703fec
\fBs\fR
703fec
to also dump external shared mounts (default behavior is to abort dumping if such mounts are found)\&. If
703fec
\fIflags\fR
703fec
are not provided, colon is optional\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-external dev[\fR\fImajor\fR\fB/\fR\fIminor\fR\fB]:\fR\fIname\fR
703fec
.RS 4
703fec
Allow to dump a mount namespace having a real block device mounted\&. A block device is identified by its
703fec
\fImajor\fR
703fec
and
703fec
\fIminor\fR
703fec
numbers, and
703fec
\fBcriu\fR
703fec
saves its information to image under the identifier
703fec
\fIname\fR\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-external file[\fR\fImnt_id\fR\fB:\fR\fIinode\fR\fB]\fR
703fec
.RS 4
703fec
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
703fec
\fImnt_id\fR
703fec
(a field obtained from
703fec
\fB/proc/\fR\fIpid\fR\fB/fdinfo/\fR\fIN\fR) and
703fec
\fIinode\fR
703fec
(as returned by
703fec
\fBstat\fR(2))\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-external tty[\fR\fIrdev\fR\fB:\fR\fIdev\fR\fB]\fR
703fec
.RS 4
703fec
Dump an external TTY, identified by
703fec
\fBst_rdev\fR
703fec
and
703fec
\fBst_dev\fR
703fec
fields returned by
703fec
\fBstat\fR(2)\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-external unix[\fR\fIid\fR\fB]\fR
703fec
.RS 4
703fec
Tell
703fec
\fBcriu\fR
703fec
that one end of a pair of UNIX sockets (created by
703fec
\fBsocketpair\fR(2)) with
703fec
\fIid\fR
703fec
is OK to be disconnected\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-freeze\-cgroup\fR
703fec
.RS 4
703fec
Use cgroup freezer to collect processes\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-manage\-cgroups\fR
703fec
.RS 4
703fec
Collect cgroups into the image thus they gonna be restored then\&. Without this option,
703fec
\fBcriu\fR
703fec
will not save cgroups configuration associated with a task\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-cgroup\-props\fR \fIspec\fR
703fec
.RS 4
703fec
Specify controllers and their properties to be saved into the image file\&.
703fec
\fBcriu\fR
703fec
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\&.
703fec
.sp
703fec
\fIspec\fR
703fec
argument describes the controller and properties specification in a simplified YAML form:
703fec
.sp
703fec
.if n \{\
703fec
.RS 4
703fec
.\}
703fec
.fam C
703fec
.ps -1
703fec
.nf
703fec
.BB lightgray
703fec
"c1":
703fec
 \- "strategy": "merge"
703fec
 \- "properties": ["a", "b"]
703fec
"c2":
703fec
 \- "strategy": "replace"
703fec
 \- "properties": ["c", "d"]
703fec
.EB lightgray
703fec
.fi
703fec
.fam
703fec
.ps +1
703fec
.if n \{\
703fec
.RE
703fec
.\}
703fec
.sp
703fec
where
703fec
\fIc1\fR
703fec
and
703fec
\fIc2\fR
703fec
are controllers names, and
703fec
\fIa\fR,
703fec
\fIb\fR,
703fec
\fIc\fR,
703fec
\fId\fR
703fec
are their properties\&.
703fec
.sp
703fec
Note the format: double quotes, spaces and new lines are required\&. The
703fec
\fIstrategy\fR
703fec
specifies what to do if a controller specified already exists as a built\-in one:
703fec
\fBcriu\fR
703fec
can either
703fec
\fBmerge\fR
703fec
or
703fec
\fBreplace\fR
703fec
such\&.
703fec
.sp
703fec
For example, the command line for the above example should look like this:
703fec
.sp
703fec
.if n \{\
703fec
.RS 4
703fec
.\}
703fec
.fam C
703fec
.ps -1
703fec
.nf
703fec
.BB lightgray
703fec
\-\-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"]"
703fec
.EB lightgray
703fec
.fi
703fec
.fam
703fec
.ps +1
703fec
.if n \{\
703fec
.RE
703fec
.\}
703fec
.RE
703fec
.PP
703fec
\fB\-\-cgroup\-props\-file\fR \fIfile\fR
703fec
.RS 4
703fec
Same as
703fec
\fB\-\-cgroup\-props\fR, except the specification is read from the
703fec
\fIfile\fR\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-cgroup\-dump\-controller\fR \fIname\fR
703fec
.RS 4
703fec
Dump a controller with
703fec
\fIname\fR
703fec
only, skipping anything else that was discovered automatically (usually via
703fec
\fB/proc\fR)\&. This option is useful when one needs
703fec
\fBcriu\fR
703fec
to skip some controllers\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-cgroup\-props\-ignore\-default\fR
703fec
.RS 4
703fec
When combined with
703fec
\fB\-\-cgroup\-props\fR, makes
703fec
\fBcriu\fR
703fec
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\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-tcp\-established\fR
703fec
.RS 4
703fec
Checkpoint established TCP connections\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-skip\-in\-flight\fR
703fec
.RS 4
703fec
This option skips in\-flight TCP connections\&. If any TCP connections that are not yet completely established are found,
703fec
\fBcriu\fR
703fec
ignores these connections, rather than errors out\&. The TCP stack on the client side is expected to handle the re\-connect gracefully\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-evasive\-devices\fR
703fec
.RS 4
703fec
Use any path to a device file if the original one is inaccessible\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-page\-server\fR
703fec
.RS 4
703fec
Send pages to a page server (see the
703fec
\fBpage\-server\fR
703fec
command)\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-force\-irmap\fR
703fec
.RS 4
703fec
Force resolving names for inotify and fsnotify watches\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-auto\-dedup\fR
703fec
.RS 4
703fec
Deduplicate "old" data in pages images of previous
703fec
\fBdump\fR\&. This option implies incremental
703fec
\fBdump\fR
703fec
mode (see the
703fec
\fBpre\-dump\fR
703fec
command)\&.
703fec
.RE
703fec
.PP
703fec
\fB\-l\fR, \fB\-\-file\-locks\fR
703fec
.RS 4
703fec
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\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-link\-remap\fR
703fec
.RS 4
703fec
Allows to link unlinked files back, if possible (modifies filesystem during
703fec
\fBrestore\fR)\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-ghost\-limit\fR \fIsize\fR
703fec
.RS 4
703fec
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
703fec
\fIsize\fR
703fec
may be postfixed with a
703fec
\fBK\fR,
703fec
\fBM\fR
703fec
or
703fec
\fBG\fR, which stands for kilo\-, mega, and gigabytes, accordingly\&.
703fec
.RE
703fec
.PP
703fec
\fB\-j\fR, \fB\-\-shell\-job\fR
703fec
.RS 4
703fec
Allow one to dump shell jobs\&. This implies the restored task will inherit session and process group ID from the
703fec
\fBcriu\fR
703fec
itself\&. This option also allows to migrate a single external tty connection, to migrate applications like
703fec
\fBtop\fR\&. If used with
703fec
\fBdump\fR
703fec
command, it must be specified with
703fec
\fBrestore\fR
703fec
as well\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-cpu\-cap\fR [\fIcap\fR[,\fIcap\fR\&...]]
703fec
.RS 4
703fec
Specify CPU capabilities to write to an image file\&. The argument is a comma\-separated list of:
703fec
.sp
703fec
.RS 4
703fec
.ie n \{\
703fec
\h'-04'\(bu\h'+03'\c
703fec
.\}
703fec
.el \{\
703fec
.sp -1
703fec
.IP \(bu 2.3
703fec
.\}
703fec
\fBnone\fR
703fec
to ignore capabilities at all; the image will not be produced on dump, neither any check performed on restore;
703fec
.RE
703fec
.sp
703fec
.RS 4
703fec
.ie n \{\
703fec
\h'-04'\(bu\h'+03'\c
703fec
.\}
703fec
.el \{\
703fec
.sp -1
703fec
.IP \(bu 2.3
703fec
.\}
703fec
\fBfpu\fR
703fec
to check if FPU module is compatible;
703fec
.RE
703fec
.sp
703fec
.RS 4
703fec
.ie n \{\
703fec
\h'-04'\(bu\h'+03'\c
703fec
.\}
703fec
.el \{\
703fec
.sp -1
703fec
.IP \(bu 2.3
703fec
.\}
703fec
\fBins\fR
703fec
to check if CPU supports all instructions required;
703fec
.RE
703fec
.sp
703fec
.RS 4
703fec
.ie n \{\
703fec
\h'-04'\(bu\h'+03'\c
703fec
.\}
703fec
.el \{\
703fec
.sp -1
703fec
.IP \(bu 2.3
703fec
.\}
703fec
\fBcpu\fR
703fec
to check if CPU capabilities are exactly matching;
703fec
.RE
703fec
.sp
703fec
.RS 4
703fec
.ie n \{\
703fec
\h'-04'\(bu\h'+03'\c
703fec
.\}
703fec
.el \{\
703fec
.sp -1
703fec
.IP \(bu 2.3
703fec
.\}
703fec
\fBall\fR
703fec
for all above set\&.
703fec
.RE
703fec
.sp
703fec
By default the option is set to
703fec
\fBfpu\fR
703fec
and
703fec
\fBins\fR\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-cgroup\-root\fR [\fIcontroller\fR:]/\fInewroot\fR
703fec
.RS 4
703fec
Change the root for the controller that will be dumped\&. By default,
703fec
\fBcriu\fR
703fec
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\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-lazy\-pages\fR
703fec
.RS 4
703fec
Perform the dump procedure without writing memory pages into the image files and prepare to service page requests over the network\&. When
703fec
\fBdump\fR
703fec
runs in this mode it presumes that
703fec
\fBlazy\-pages\fR
703fec
daemon will connect to it and fetch memory pages to lazily inject them into the restored process address space\&. This option is intended for post\-copy (lazy) migration and should be used in conjunction with
703fec
\fBrestore\fR
703fec
with appropriate options\&.
703fec
.RE
703fec
.SS "restore"
703fec
.sp
703fec
Restores previously checkpointed processes\&.
703fec
.PP
703fec
\fB\-\-inherit\-fd\fR \fBfd[\fR\fIN\fR\fB]:\fR\fIresource\fR
703fec
.RS 4
703fec
Inherit a file descriptor\&. This option lets
703fec
\fBcriu\fR
703fec
use an already opened file descriptor
703fec
\fIN\fR
703fec
for restoring a file identified by
703fec
\fIresource\fR\&. This option can be used to restore an external resource dumped with the help of
703fec
\fB\-\-external\fR
703fec
\fBfile\fR,
703fec
\fBtty\fR, and
703fec
\fBunix\fR
703fec
options\&.
703fec
.sp
703fec
The
703fec
\fIresource\fR
703fec
argument can be one of the following:
703fec
.sp
703fec
.RS 4
703fec
.ie n \{\
703fec
\h'-04'\(bu\h'+03'\c
703fec
.\}
703fec
.el \{\
703fec
.sp -1
703fec
.IP \(bu 2.3
703fec
.\}
703fec
\fBtty[\fR\fIrdev\fR\fB:\fR\fIdev\fR\fB]\fR
703fec
.RE
703fec
.sp
703fec
.RS 4
703fec
.ie n \{\
703fec
\h'-04'\(bu\h'+03'\c
703fec
.\}
703fec
.el \{\
703fec
.sp -1
703fec
.IP \(bu 2.3
703fec
.\}
703fec
\fBpipe[\fR\fIinode\fR\fB]\fR
703fec
.RE
703fec
.sp
703fec
.RS 4
703fec
.ie n \{\
703fec
\h'-04'\(bu\h'+03'\c
703fec
.\}
703fec
.el \{\
703fec
.sp -1
703fec
.IP \(bu 2.3
703fec
.\}
703fec
\fBsocket[\fR\fIinode\fR\fB]\fR
703fec
.RE
703fec
.sp
703fec
.RS 4
703fec
.ie n \{\
703fec
\h'-04'\(bu\h'+03'\c
703fec
.\}
703fec
.el \{\
703fec
.sp -1
703fec
.IP \(bu 2.3
703fec
.\}
703fec
\fBfile[\fR\fImnt_id\fR\fB:\fR\fIinode\fR\fB]\fR
703fec
.RE
703fec
.sp
703fec
.RS 4
703fec
.ie n \{\
703fec
\h'-04'\(bu\h'+03'\c
703fec
.\}
703fec
.el \{\
703fec
.sp -1
703fec
.IP \(bu 2.3
703fec
.\}
703fec
\fIpath/to/file\fR
703fec
.RE
703fec
.sp
703fec
Note that square brackets used in this option arguments are literals and usually need to be escaped from shell\&.
703fec
.RE
703fec
.PP
703fec
\fB\-d\fR, \fB\-\-restore\-detached\fR
703fec
.RS 4
703fec
Detach
703fec
\fBcriu\fR
703fec
itself once restore is complete\&.
703fec
.RE
703fec
.PP
703fec
\fB\-s\fR, \fB\-\-leave\-stopped\fR
703fec
.RS 4
703fec
Leave tasks in stopped state after restore (rather than resuming their execution)\&.
703fec
.RE
703fec
.PP
703fec
\fB\-S\fR, \fB\-\-restore\-sibling\fR
703fec
.RS 4
703fec
Restore root task as a sibling (makes sense only with
703fec
\fB\-\-restore\-detached\fR)\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-log\-pid\fR
703fec
.RS 4
703fec
Write separate logging files per each pid\&.
703fec
.RE
703fec
.PP
703fec
\fB\-r\fR, \fB\-\-root\fR \fIpath\fR
703fec
.RS 4
703fec
Change the root filesystem to
703fec
\fIpath\fR
703fec
(when run in a mount namespace)\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-external\fR \fItype\fR\fB[\fR\fIid\fR\fB]:\fR\fIvalue\fR
703fec
.RS 4
703fec
Restore an instance of an external resource\&. The generic syntax is
703fec
\fItype\fR
703fec
of resource, followed by resource
703fec
\fIid\fR
703fec
(enclosed in literal square brackets), and optional
703fec
\fIvalue\fR
703fec
(prepended by a literal colon)\&. The following resource types are currently supported:
703fec
\fBmnt\fR,
703fec
\fBdev\fR,
703fec
\fBveth\fR,
703fec
\fBmacvlan\fR\&. Syntax depends on type\&. Note to restore external resources dealing with opened file descriptors (such as dumped with the help of
703fec
\fB\-\-external\fR
703fec
\fBfile\fR,
703fec
\fBtty\fR, and
703fec
\fBunix\fR
703fec
options), option
703fec
\fB\-\-inherit\-fd\fR
703fec
should be used\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-external mnt[\fR\fIname\fR\fB]:\fR\fImountpoint\fR
703fec
.RS 4
703fec
Restore an external bind mount referenced in the image by
703fec
\fIname\fR, bind\-mounting it from the host
703fec
\fImountpoint\fR
703fec
to a proper mount point\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-external mnt[]\fR
703fec
.RS 4
703fec
Restore all external bind mounts (dumped with the help of
703fec
\fB\-\-external mnt[]\fR
703fec
auto\-detection)\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-external dev[\fR\fIname\fR\fB]:\fR\fI/dev/path\fR
703fec
.RS 4
703fec
Restore an external mount device, identified in the image by
703fec
\fIname\fR, using the existing block device
703fec
\fI/dev/path\fR\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-external veth[\fR\fIinner_dev\fR\fB]:\fR\fIouter_dev\fR\fB@\fR\fIbridge\fR
703fec
.RS 4
703fec
Set the outer VETH device name (corresponding to
703fec
\fIinner_dev\fR
703fec
being restored) to
703fec
\fIouter_dev\fR\&. If optional
703fec
\fB@\fR\fIbridge\fR
703fec
is specified,
703fec
\fIouter_dev\fR
703fec
is added to that bridge\&. If the option is not used,
703fec
\fIouter_dev\fR
703fec
will be autogenerated by the kernel\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-external macvlan[\fR\fIinner_dev\fR\fB]:\fR\fIouter_dev\fR
703fec
.RS 4
703fec
When restoring an image that have a MacVLAN device in it, this option must be used to specify to which
703fec
\fIouter_dev\fR
703fec
(an existing network device in CRIU namespace) the restored
703fec
\fIinner_dev\fR
703fec
should be bound to\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-manage\-cgroups\fR [\fImode\fR]
703fec
.RS 4
703fec
Restore cgroups configuration associated with a task from the image\&. Controllers are always restored in an optimistic way \(em if already present in system,
703fec
\fBcriu\fR
703fec
reuses it, otherwise it will be created\&.
703fec
.RE
703fec
.sp
703fec
The \fImode\fR may be one of the following:
703fec
.PP
703fec
\fBnone\fR
703fec
.RS 4
703fec
Do not restore cgroup properties but require cgroup to pre\-exist at the moment of
703fec
\fBrestore\fR
703fec
procedure\&.
703fec
.RE
703fec
.PP
703fec
\fBprops\fR
703fec
.RS 4
703fec
Restore cgroup properties and require cgroup to pre\-exist\&.
703fec
.RE
703fec
.PP
703fec
\fBsoft\fR
703fec
.RS 4
703fec
Restore cgroup properties if only cgroup has been created by
703fec
\fBcriu\fR, otherwise do not restore properties\&. This is the default if mode is unspecified\&.
703fec
.RE
703fec
.PP
703fec
\fBfull\fR
703fec
.RS 4
703fec
Always restore all cgroups and their properties\&.
703fec
.RE
703fec
.PP
703fec
\fBstrict\fR
703fec
.RS 4
703fec
Restore all cgroups and their properties from the scratch, requiring them to not present in the system\&.
703fec
.PP
703fec
\fB\-\-cgroup\-root\fR [\fIcontroller\fR\fB:\fR]/\fInewroot\fR
703fec
.RS 4
703fec
Change the root cgroup the controller will be installed into\&. No controller means that root is the default for all controllers not specified\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-tcp\-established\fR
703fec
.RS 4
703fec
Restore previously dumped established TCP connections\&. This implies that the network has been locked between
703fec
\fBdump\fR
703fec
and
703fec
\fBrestore\fR
703fec
phases so other side of a connection simply notice a kind of lag\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-tcp\-close\fR
703fec
.RS 4
703fec
Restore connected TCP sockets in closed state\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-veth\-pair\fR \fIIN\fR\fB=\fR\fIOUT\fR
703fec
.RS 4
703fec
Correspondence between outside and inside names of veth devices\&.
703fec
.RE
703fec
.PP
703fec
\fB\-l\fR, \fB\-\-file\-locks\fR
703fec
.RS 4
703fec
Restore file locks from the image\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-lsm\-profile\fR \fItype\fR\fB:\fR\fIname\fR
703fec
.RS 4
703fec
Specify an LSM profile to be used during restore\&. The
703fec
\FCtype\F[]
703fec
can be either
703fec
\fBapparmor\fR
703fec
or
703fec
\fBselinux\fR\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-auto\-dedup\fR
703fec
.RS 4
703fec
As soon as a page is restored it get punched out from image\&.
703fec
.RE
703fec
.PP
703fec
\fB\-j\fR, \fB\-\-shell\-job\fR
703fec
.RS 4
703fec
Restore shell jobs, in other words inherit session and process group ID from the criu itself\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-cpu\-cap\fR [\fIcap\fR[,\fIcap\fR\&...]]
703fec
.RS 4
703fec
Specify CPU capabilities to be present on the CPU the process is restoring\&. To inverse a capability, prefix it with
703fec
\fB^\fR\&. This option implies that
703fec
\fB\-\-cpu\-cap\fR
703fec
has been passed on
703fec
\fBdump\fR
703fec
as well, except
703fec
\fBfpu\fR
703fec
option case\&. The
703fec
\fIcap\fR
703fec
argument can be the following (or a set of comma\-separated values):
703fec
.RE
703fec
.RE
703fec
.PP
703fec
\fBall\fR
703fec
.RS 4
703fec
Require all capabilities\&. This is
703fec
\fBdefault\fR
703fec
mode if
703fec
\fB\-\-cpu\-cap\fR
703fec
is passed without arguments\&. Most safe mode\&.
703fec
.RE
703fec
.PP
703fec
\fBcpu\fR
703fec
.RS 4
703fec
Require the CPU to have all capabilities in image to match runtime CPU\&.
703fec
.RE
703fec
.PP
703fec
\fBfpu\fR
703fec
.RS 4
703fec
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
703fec
\fBdefault\fR
703fec
mode if
703fec
\fB\-\-cpu\-cap\fR
703fec
is not present in command line\&. Note this argument might be passed even if on the
703fec
\fBdump\fR
703fec
no
703fec
\fB\-\-cpu\-cap\fR
703fec
have been specified because FPU frames are always encoded into images\&.
703fec
.RE
703fec
.PP
703fec
\fBins\fR
703fec
.RS 4
703fec
Require CPU compatibility on instructions level\&.
703fec
.RE
703fec
.PP
703fec
\fBnone\fR
703fec
.RS 4
703fec
Ignore capabilities\&. Most dangerous mode\&. The behaviour is implementation dependent\&. Try to not use it until really required\&.
703fec
.sp
703fec
For example, this option can be used in case
703fec
\fB\-\-cpu\-cap=cpu\fR
703fec
was used during
703fec
\fBdump\fR, and images are migrated to a less capable CPU and are to be restored\&. By default,
703fec
\fBcriu\fR
703fec
shows an error that CPU capabilities are not adequate, but this can be suppressed by using
703fec
\fB\-\-cpu\-cap=none\fR\&.
703fec
.PP
703fec
\fB\-\-weak\-sysctls\fR
703fec
.RS 4
703fec
Silently skip restoring sysctls that are not available\&. This allows to restore on an older kernel, or a kernel configured without some options\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-lazy\-pages\fR
703fec
.RS 4
703fec
Restore the processes without filling out the entire memory contents\&. When this option is used,
703fec
\fBrestore\fR
703fec
sets up the infrastructure required to fill memory pages either on demand when the process accesses them or in the background without stopping the restored process\&. This option requires running
703fec
\fBlazy\-pages\fR
703fec
daemon\&.
703fec
.RE
703fec
.RE
703fec
.SS "check"
703fec
.sp
703fec
Checks whether the kernel supports the features needed by \fBcriu\fR to dump and restore a process tree\&.
703fec
.sp
703fec
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\&.
703fec
.PP
703fec
\fBCategory 1\fR
703fec
.RS 4
703fec
Absolutely required\&. These are features like support for
703fec
\fB/proc/PID/map_files\fR,
703fec
\fBNETLINK_SOCK_DIAG\fR
703fec
socket monitoring,
703fec
\fB/proc/sys/kernel/ns_last_pid\fR
703fec
etc\&.
703fec
.RE
703fec
.PP
703fec
\fBCategory 2\fR
703fec
.RS 4
703fec
Required only for specific cases\&. These are features like AIO remap,
703fec
\fB/dev/net/tun\fR
703fec
and others that are only required if a process being dumped or restored is using those\&.
703fec
.RE
703fec
.PP
703fec
\fBCategory 3\fR
703fec
.RS 4
703fec
Experimental\&. These are features like
703fec
\fBtask\-diag\fR
703fec
that are used for experimental purposes (mostly during development)\&.
703fec
.RE
703fec
.sp
703fec
If there are no errors or warnings, \fBcriu\fR prints "Looks good\&." and its exit code is 0\&.
703fec
.sp
703fec
A missing Category 1 feature causes \fBcriu\fR to print "Does not look good\&." and its exit code is non\-zero\&.
703fec
.sp
703fec
Missing Category 2 and 3 features cause \fBcriu\fR to print "Looks good but \&..." and its exit code is be non\-zero\&.
703fec
.sp
703fec
Without any options, \fBcriu check\fR checks Category 1 features\&. This behavior can be changed by using the following options:
703fec
.PP
703fec
\fB\-\-extra\fR
703fec
.RS 4
703fec
Check kernel support for Category 2 features\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-experimental\fR
703fec
.RS 4
703fec
Check kernel support for Category 3 features\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-all\fR
703fec
.RS 4
703fec
Check kernel support for Category 1, 2, and 3 features\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-feature\fR \fIname\fR
703fec
.RS 4
703fec
Check a specific feature\&. If
703fec
\fIname\fR
703fec
is
703fec
\fBlist\fR, a list of valid kernel feature names that can be checked will be printed\&.
703fec
.RE
703fec
.SS "page\-server"
703fec
.sp
703fec
Launches \fBcriu\fR in page server mode\&.
703fec
.PP
703fec
\fB\-\-daemon\fR
703fec
.RS 4
703fec
Runs page server as a daemon (background process)\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-status\-fd\fR
703fec
.RS 4
703fec
Write \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\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-address\fR \fIaddress\fR
703fec
.RS 4
703fec
Page server IP address or hostname\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-port\fR \fInumber\fR
703fec
.RS 4
703fec
Page server port number\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-ps\-socket\fR \fIfd\fR
703fec
.RS 4
703fec
Use provided file descriptor as socket for incoming connection\&. In this case \-\-address and \-\-port are ignored\&. Useful for intercepting page\-server traffic e\&.g\&. to add encryption or authentication\&.
703fec
.RE
703fec
.PP
703fec
\fB\-\-lazy\-pages\fR
703fec
.RS 4
703fec
Serve local memory dump to a remote
703fec
\fBlazy\-pages\fR
703fec
daemon\&. In this mode the
703fec
\fBpage\-server\fR
703fec
reads local memory dump and allows the remote
703fec
\fBlazy\-pages\fR
703fec
daemon to request memory pages in random order\&.
703fec
.RE
703fec
.SS "lazy\-pages"
703fec
.sp
703fec
Launches \fBcriu\fR in lazy\-pages daemon mode\&.
703fec
.sp
703fec
The \fBlazy\-pages\fR daemon is responsible for managing user\-level demand paging for the restored processes\&. It gets information required to fill the process memory pages from the \fBrestore\fR and from the checkpoint directory\&. When a restored process access certain memory page for the first time, the \fBlazy\-pages\fR daemon injects its contents into the process address space\&. The memory pages that are not yet requested by the restored processes are injected in the background\&.
703fec
.SS "exec"
703fec
.sp
703fec
Executes a system call inside a destination task\*(Aqs context\&. This functionality is deprecated; please use \fBCompel\fR instead\&.
703fec
.SS "service"
703fec
.sp
703fec
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\&.
703fec
.SS "dedup"
703fec
.sp
703fec
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\&.
703fec
.SS "cpuinfo dump"
703fec
.sp
703fec
Fetches current CPU features and write them into an image file\&.
703fec
.SS "cpuinfo check"
703fec
.sp
703fec
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\&.
703fec
.SH "CONFIGURATION FILES"
703fec
.sp
703fec
\fBCriu\fR supports usage of configuration files to avoid the need of writing every option on command line, which is useful especially with repeated usage of same options\&. A specific configuration file can be passed with the "\fB\-\-config\fR \fIfile\fR" option\&. If no file is passed, the default configuration files \fI/etc/criu/default\&.conf\fR and \fI$HOME/\&.criu/default\&.conf\fR are parsed (if present on the system)\&. If the environment variable CRIU_CONFIG_FILE is set, it will also be parsed\&.
703fec
.sp
703fec
The options passed to CRIU via CLI, RPC or configuration file are evaluated in the following order:
703fec
.sp
703fec
.RS 4
703fec
.ie n \{\
703fec
\h'-04'\(bu\h'+03'\c
703fec
.\}
703fec
.el \{\
703fec
.sp -1
703fec
.IP \(bu 2.3
703fec
.\}
703fec
apply_config(/etc/criu/default\&.conf)
703fec
.RE
703fec
.sp
703fec
.RS 4
703fec
.ie n \{\
703fec
\h'-04'\(bu\h'+03'\c
703fec
.\}
703fec
.el \{\
703fec
.sp -1
703fec
.IP \(bu 2.3
703fec
.\}
703fec
apply_config($HOME/\&.criu/default\&.conf)
703fec
.RE
703fec
.sp
703fec
.RS 4
703fec
.ie n \{\
703fec
\h'-04'\(bu\h'+03'\c
703fec
.\}
703fec
.el \{\
703fec
.sp -1
703fec
.IP \(bu 2.3
703fec
.\}
703fec
apply_config(CRIU_CONFIG_FILE)
703fec
.RE
703fec
.sp
703fec
.RS 4
703fec
.ie n \{\
703fec
\h'-04'\(bu\h'+03'\c
703fec
.\}
703fec
.el \{\
703fec
.sp -1
703fec
.IP \(bu 2.3
703fec
.\}
703fec
apply_config(\fB\-\-config\fR
703fec
\fIfile\fR)
703fec
.RE
703fec
.sp
703fec
.RS 4
703fec
.ie n \{\
703fec
\h'-04'\(bu\h'+03'\c
703fec
.\}
703fec
.el \{\
703fec
.sp -1
703fec
.IP \(bu 2.3
703fec
.\}
703fec
apply_config(CLI) or apply_config(RPC)
703fec
.RE
703fec
.sp
703fec
.RS 4
703fec
.ie n \{\
703fec
\h'-04'\(bu\h'+03'\c
703fec
.\}
703fec
.el \{\
703fec
.sp -1
703fec
.IP \(bu 2.3
703fec
.\}
703fec
apply_config(RPC configuration file) (only for RPC mode)
703fec
.RE
703fec
.sp
703fec
Default configuration file parsing can be deactivated with "\fB\-\-no\-default\-config\fR" if needed\&. Parsed configuration files are merged with command line options, which allows overriding boolean options\&.
703fec
.SS "Configuration file syntax"
703fec
.sp
703fec
Comments are supported using \*(Aq#\*(Aq sign\&. The rest of the line is ignored\&. Options are the same as command line options without the \*(Aq\-\-\*(Aq prefix, use one option per line (with corresponding argument if applicable, divided by whitespaces)\&. If needed, the argument can be provided in double quotes (this should be needed only if the argument contains whitespaces)\&. In case this type of argument contains a literal double quote as well, it can be escaped using the \*(Aq\e\*(Aq sign\&. Usage of commands is disallowed and all other escape sequences are interpreted literally\&.
703fec
.sp
703fec
Example of configuration file to illustrate syntax:
703fec
.sp
703fec
.if n \{\
703fec
.RS 4
703fec
.\}
703fec
.fam C
703fec
.ps -1
703fec
.nf
703fec
.BB lightgray
703fec
$ cat ~/\&.criu/default\&.conf
703fec
tcp\-established
703fec
work\-dir "/home/USERNAME/criu/my \e"work\e" directory"
703fec
#this is a comment
703fec
no\-restore\-sibling   # this is another comment
703fec
.EB lightgray
703fec
.fi
703fec
.fam
703fec
.ps +1
703fec
.if n \{\
703fec
.RE
703fec
.\}
703fec
.SS "Configuration files in RPC mode"
703fec
.sp
703fec
Not only does \fBcriu\fR evaluate configuration files in CLI mode, it also evaluates configuration files in RPC mode\&. Just as in CLI mode the configuration file values are evaluated first\&. This means that any option set via RPC will overwrite the configuration file setting\&. The user can thus change \fBcriu\fR\*(Aqs default behavior but it is not possible to change settings which are explicitly set by the RPC client\&.
703fec
.sp
703fec
The RPC client can, however, specify an additional configuration file which will be evaluated after the RPC options (see above for option evaluation order)\&. The RPC client can specify this additional configuration file via "req\&.opts\&.config_file = \fI/path/to/file\fR"\&. The values from this configuration file will overwrite all other configuration file settings or RPC options\&. \fBThis can lead to undesired behavior of criu and should only be used carefully\&.\fR
703fec
.SH "EXAMPLES"
703fec
.sp
703fec
To checkpoint a program with pid of \fB1234\fR and write all image files into directory \fBcheckpoint\fR:
703fec
.sp
703fec
.if n \{\
703fec
.RS 4
703fec
.\}
703fec
.fam C
703fec
.ps -1
703fec
.nf
703fec
.BB lightgray
703fec
    criu dump \-D checkpoint \-t 1234
703fec
.EB lightgray
703fec
.fi
703fec
.fam
703fec
.ps +1
703fec
.if n \{\
703fec
.RE
703fec
.\}
703fec
.sp
703fec
To restore this program detaching criu itself:
703fec
.sp
703fec
.if n \{\
703fec
.RS 4
703fec
.\}
703fec
.fam C
703fec
.ps -1
703fec
.nf
703fec
.BB lightgray
703fec
    criu restore \-d \-D checkpoint
703fec
.EB lightgray
703fec
.fi
703fec
.fam
703fec
.ps +1
703fec
.if n \{\
703fec
.RE
703fec
.\}
703fec
.SH "AUTHOR"
703fec
.sp
703fec
The CRIU team\&.
703fec
.SH "COPYRIGHT"
703fec
.sp
703fec
Copyright (C) 2011\-2016, Parallels Holdings, Inc\&.