'\" t .\" Title: criu .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 09/22/2024 .\" Manual: CRIU Manual .\" Source: criu 4.0 .\" Language: English .\" .TH "CRIU" "8" "09/22/2024" "criu 4\&.0" "CRIU Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * (re)Define some macros .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" toupper - uppercase a string (locale-aware) .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .de toupper .tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ \\$* .tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz .. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" SH-xref - format a cross-reference to an SH section .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .de SH-xref .ie n \{\ .\} .toupper \\$* .el \{\ \\$* .\} .. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" SH - level-one heading that works better for non-TTY output .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .de1 SH .\" put an extra blank line of space above the head in non-TTY output .if t \{\ .sp 1 .\} .sp \\n[PD]u .nr an-level 1 .set-an-margin .nr an-prevailing-indent \\n[IN] .fi .in \\n[an-margin]u .ti 0 .HTML-TAG ".NH \\n[an-level]" .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 \." make the size of the head bigger .ps +3 .ft B .ne (2v + 1u) .ie n \{\ .\" if n (TTY output), use uppercase .toupper \\$* .\} .el \{\ .nr an-break-flag 0 .\" if not n (not TTY), use normal case (not uppercase) \\$1 .in \\n[an-margin]u .ti 0 .\" if not n (not TTY), put a border/line under subheading .sp -.6 \l'\n(.lu' .\} .. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" SS - level-two heading that works better for non-TTY output .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .de1 SS .sp \\n[PD]u .nr an-level 1 .set-an-margin .nr an-prevailing-indent \\n[IN] .fi .in \\n[IN]u .ti \\n[SN]u .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .ps \\n[PS-SS]u \." make the size of the head bigger .ps +2 .ft B .ne (2v + 1u) .if \\n[.$] \&\\$* .. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" BB/EB - put background/screen (filled box) around block of text .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .de BB .if t \{\ .sp -.5 .br .in +2n .ll -2n .gcolor red .di BX .\} .. .de EB .if t \{\ .if "\\$2"adjust-for-leading-newline" \{\ .sp -1 .\} .br .di .in .ll .gcolor .nr BW \\n(.lu-\\n(.i .nr BH \\n(dn+.5v .ne \\n(BHu+.5v .ie "\\$2"adjust-for-leading-newline" \{\ \M[\\$1]\h'1n'\v'+.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] .\} .el \{\ \M[\\$1]\h'1n'\v'-.5v'\D'P \\n(BWu 0 0 \\n(BHu -\\n(BWu 0 0 -\\n(BHu'\M[] .\} .in 0 .sp -.5v .nf .BX .in .sp .5v .fi .\} .. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" BM/EM - put colored marker in margin next to block of text .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .de BM .if t \{\ .br .ll -2n .gcolor red .di BX .\} .. .de EM .if t \{\ .br .di .ll .gcolor .nr BH \\n(dn .ne \\n(BHu \M[\\$1]\D'P -.75n 0 0 \\n(BHu -(\\n[.i]u - \\n(INu - .75n) 0 0 -\\n(BHu'\M[] .in 0 .nf .BX .in .fi .\} .. .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "Name" criu \- checkpoint/restore in userspace .SH "Synopsis" .sp \fBcriu\fR \fIcommand\fR [\fIoption\fR \&...] .SH "DESCRIPTION" .sp \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\&. .SH "OPTIONS" .sp Most of the long flags can be prefixed with \fBno\-\fR to negate the option (example: \fB\-\-display\-stats\fR and \fB\-\-no\-display\-stats\fR)\&. .SS "Common options" .sp Common options are applicable to any \fIcommand\fR\&. .PP \fB\-v\fR[\fBv\fR\&...], \fB\-\-verbosity\fR .RS 4 Increase verbosity up from the default level\&. In case of short option, multiple \fBv\fR can be used, each increasing verbosity by one\&. .RE .PP \fB\-v\fR\fInum\fR, \fB\-\-verbosity=\fR\fInum\fR .RS 4 Set verbosity level to \fInum\fR\&. The higher the level, the more output is produced\&. The following levels are available: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fB\-v0\fR no output; .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fB\-v1\fR only errors; .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fB\-v2\fR above plus warnings (this is the default level); .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fB\-v3\fR above plus information messages and timestamps; .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fB\-v4\fR above plus lots of debug\&. .RE .RE .PP \fB\-\-config\fR \fIfile\fR .RS 4 Pass a specific configuration file to criu\&. .RE .PP \fB\-\-no\-default\-config\fR .RS 4 Disable parsing of default configuration files\&. .RE .PP \fB\-\-pidfile\fR \fIfile\fR .RS 4 Write root task, service or page\-server pid into a \fIfile\fR\&. .RE .PP \fB\-o\fR, \fB\-\-log\-file\fR \fIfile\fR .RS 4 Write logging messages to a \fIfile\fR\&. .RE .PP \fB\-\-display\-stats\fR .RS 4 During dump, as well as during restore, \fBcriu\fR collects some statistics, like the time required to dump or restore the process, or the number of pages dumped or restored\&. This information is always saved to the \fBstats\-dump\fR and \fBstats\-restore\fR files, and can be shown using \fBcrit\fR(1)\&. The option \fB\-\-display\-stats\fR prints out this information on the console at the end of a dump or restore operation\&. .RE .PP \fB\-D\fR, \fB\-\-images\-dir\fR \fIpath\fR .RS 4 Use \fIpath\fR as a base directory where to look for sets of image files\&. .RE .PP \fB\-\-stream\fR .RS 4 dump/restore images using criu\-image\-streamer\&. See \m[blue]\fBhttps://github\&.com/checkpoint\-restore/criu\-image\-streamer\fR\m[] for detailed usage\&. .RE .PP \fB\-\-prev\-images\-dir\fR \fIpath\fR .RS 4 Use \fIpath\fR as a parent directory where to look for sets of image files\&. This option makes sense in case of incremental dumps\&. .RE .PP \fB\-W\fR, \fB\-\-work\-dir\fR \fIdir\fR .RS 4 Use directory \fIdir\fR for putting logs, pidfiles and statistics\&. If not specified, \fIpath\fR from \fB\-D\fR option is taken\&. .RE .PP \fB\-\-close\fR \fIfd\fR .RS 4 Close file descriptor \fIfd\fR before performing any actions\&. .RE .PP \fB\-L\fR, \fB\-\-libdir\fR \fIpath\fR .RS 4 Path to plugins directory\&. .RE .PP \fB\-\-enable\-fs\fR [\fIfs\fR[,\fIfs\fR\&...]] .RS 4 Specify a comma\-separated list of filesystem names that should be auto\-detected\&. The value \fIall\fR enables auto\-detection for all filesystems\&. .sp Note: This option is not safe, use at your own risk\&. Auto\-detecting a filesystem mount assumes that the mountpoint can be restored with \fBmount(src, mountpoint, flags, options)\fR\&. When used, \fBdump\fR is expected to always succeed if a mountpoint is to be auto\-detected, however \fBrestore\fR may fail (or do something wrong) if the assumption for restore logic is incorrect\&. This option is not compatible with \fB\-\-external\fR \fBdev\fR\&. .RE .PP \fB\-\-action\-script\fR \fIscript\fR .RS 4 Add an external action script to be executed at certain stages\&. The environment variable \fBCRTOOLS_SCRIPT_ACTION\fR is available to the script to find out which action is being executed, and its value can be one of the following: .PP \fBpre\-dump\fR .RS 4 run prior to beginning a \fBdump\fR .RE .PP \fBpost\-dump\fR .RS 4 run upon \fBdump\fR completion .RE .PP \fBpre\-restore\fR .RS 4 run prior to beginning a \fBrestore\fR .RE .PP \fBpost\-restore\fR .RS 4 run upon \fBrestore\fR completion .RE .PP \fBpre\-resume\fR .RS 4 run when all processes and resources are restored but tasks are stopped waiting for final kick to run\&. Must not fail\&. .RE .PP \fBpost\-resume\fR .RS 4 called at the very end, when everything is restored and processes were resumed .RE .PP \fBnetwork\-lock\fR .RS 4 run to lock network in a target network namespace .RE .PP \fBnetwork\-unlock\fR .RS 4 run to unlock network in a target network namespace .RE .PP \fBsetup\-namespaces\fR .RS 4 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 .RE .PP \fBpost\-setup\-namespaces\fR .RS 4 called after the namespaces are configured .RE .PP \fBorphan\-pts\-master\fR .RS 4 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 .RE .PP \fBquery\-ext\-files\fR .RS 4 called after the process tree is stopped and network is locked\&. This hook is used only in the RPC mode\&. The notification reply contains file ids to be added to external file list (may be empty)\&. .RE .RE .PP \fB\-\-unprivileged\fR .RS 4 This option tells \fBcriu\fR to accept the limitations when running as non\-root\&. Running as non\-root requires \fBcriu\fR at least to have \fBCAP_SYS_ADMIN\fR or \fBCAP_CHECKPOINT_RESTORE\fR\&. For details about running \fBcriu\fR as non\-root please consult the \fBNON\-ROOT\fR section\&. .RE .PP \fB\-V\fR, \fB\-\-version\fR .RS 4 Print program version and exit\&. .RE .PP \fB\-h\fR, \fB\-\-help\fR .RS 4 Print some help and exit\&. .RE .SS "pre\-dump" .sp 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\&. .PP \fB\-\-track\-mem\fR .RS 4 Turn on memory changes tracker in the kernel\&. If the option is not passed the memory tracker get turned on implicitly\&. .RE .PP \fB\-\-pre\-dump\-mode\fR=\fImode\fR .RS 4 There are two \fImode\fR to operate pre\-dump algorithm\&. The \fIsplice\fR mode is parasite based, whereas \fIread\fR mode is based on process_vm_readv syscall\&. The \fIread\fR mode incurs reduced frozen time and reduced memory pressure as compared to \fIsplice\fR mode\&. Default is \fIsplice\fR mode\&. .RE .SS "dump" .sp Performs a checkpoint procedure\&. .PP \fB\-t\fR, \fB\-\-tree\fR \fIpid\fR .RS 4 Checkpoint the whole process tree starting from \fIpid\fR\&. .RE .PP \fB\-R\fR, \fB\-\-leave\-running\fR .RS 4 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\&. .sp Note if task is about to run after been checkpointed, it can modify TCP connections, delete files and do other dangerous actions\&. Therefore, \fBcriu\fR can not guarantee that the next \fBrestore\fR action will succeed\&. Most likely if this option is used, at least the file system snapshot must be made with the help of \fBpost\-dump\fR action script\&. .sp In other words, do not use it unless really needed\&. .RE .PP \fB\-s\fR, \fB\-\-leave\-stopped\fR .RS 4 Leave tasks in stopped state after checkpoint, instead of killing\&. .RE .PP \fB\-\-external\fR \fItype\fR\fB[\fR\fIid\fR\fB]:\fR\fIvalue\fR .RS 4 Dump an instance of an external resource\&. The generic syntax is \fItype\fR of resource, followed by resource \fIid\fR (enclosed in literal square brackets), and optional \fIvalue\fR (prepended by a literal colon)\&. The following resource types are currently supported: \fBmnt\fR, \fBdev\fR, \fBfile\fR, \fBtty\fR, \fBunix\fR\&. Syntax depends on type\&. Note to restore external resources, either \fB\-\-external\fR or \fB\-\-inherit\-fd\fR is used, depending on resource type\&. .RE .PP \fB\-\-external\fR \fBmnt[\fR\fImountpoint\fR\fB]:\fR\fIname\fR .RS 4 Dump an external bind mount referenced by \fImountpoint\fR, saving it to image under the identifier \fIname\fR\&. .RE .PP \fB\-\-external\fR \fBmnt[]:\fR\fIflags\fR .RS 4 Dump all external bind mounts, autodetecting those\&. Optional \fIflags\fR can contain \fBm\fR to also dump external master mounts, \fBs\fR to also dump external shared mounts (default behavior is to abort dumping if such mounts are found)\&. If \fIflags\fR are not provided, colon is optional\&. .RE .PP \fB\-\-external\fR \fBdev[\fR\fImajor\fR\fB/\fR\fIminor\fR\fB]:\fR\fIname\fR .RS 4 Allow to dump a mount namespace having a real block device mounted\&. A block device is identified by its \fImajor\fR and \fIminor\fR numbers, and \fBcriu\fR saves its information to image under the identifier \fIname\fR\&. .RE .PP \fB\-\-external\fR \fBfile[\fR\fImnt_id\fR\fB:\fR\fIinode\fR\fB]\fR .RS 4 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 \fImnt_id\fR (a field obtained from \fB/proc/\fR\fIpid\fR\fB/fdinfo/\fR\fIN\fR) and \fIinode\fR (as returned by \fBstat\fR(2))\&. .RE .PP \fB\-\-external\fR \fBtty[\fR\fIrdev\fR\fB:\fR\fIdev\fR\fB]\fR .RS 4 Dump an external TTY, identified by \fBst_rdev\fR and \fBst_dev\fR fields returned by \fBstat\fR(2)\&. .RE .PP \fB\-\-external\fR \fBunix[\fR\fIid\fR\fB]\fR .RS 4 Tell \fBcriu\fR that one end of a pair of UNIX sockets (created by \fBsocketpair\fR(2)) with the given \fIid\fR is OK to be disconnected\&. .RE .PP \fB\-\-external\fR \fBnet[\fR\fIinode\fR\fB]:\fR\fIname\fR .RS 4 Mark a network namespace as external and do not include it in the checkpoint\&. The label \fIname\fR can be used with \fB\-\-inherit\-fd\fR during restore to specify a file descriptor to a preconfigured network namespace\&. .RE .PP \fB\-\-external\fR \fBpid[\fR\fIinode\fR\fB]:\fR\fIname\fR .RS 4 Mark a PID namespace as external\&. This can be later used to restore a process into an existing PID namespace\&. The label \fIname\fR can be used to assign another PID namespace during restore with the help of \fB\-\-inherit\-fd\fR\&. .RE .PP \fB\-\-freeze\-cgroup\fR .RS 4 Use cgroup freezer to collect processes\&. .RE .PP \fB\-\-manage\-cgroups\fR .RS 4 Collect cgroups into the image thus they gonna be restored then\&. Without this option, \fBcriu\fR will not save cgroups configuration associated with a task\&. .RE .PP \fB\-\-cgroup\-props\fR \fIspec\fR .RS 4 Specify controllers and their properties to be saved into the image file\&. \fBcriu\fR 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\&. .sp \fIspec\fR argument describes the controller and properties specification in a simplified YAML form: .sp .if n \{\ .RS 4 .\} .fam C .ps -1 .nf .BB lightgray "c1": \- "strategy": "merge" \- "properties": ["a", "b"] "c2": \- "strategy": "replace" \- "properties": ["c", "d"] .EB lightgray .fi .fam .ps +1 .if n \{\ .RE .\} .sp where \fIc1\fR and \fIc2\fR are controllers names, and \fIa\fR, \fIb\fR, \fIc\fR, \fId\fR are their properties\&. .sp Note the format: double quotes, spaces and new lines are required\&. The \fIstrategy\fR specifies what to do if a controller specified already exists as a built\-in one: \fBcriu\fR can either \fBmerge\fR or \fBreplace\fR such\&. .sp For example, the command line for the above example should look like this: .sp .if n \{\ .RS 4 .\} .fam C .ps -1 .nf .BB lightgray \-\-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"]" .EB lightgray .fi .fam .ps +1 .if n \{\ .RE .\} .RE .PP \fB\-\-cgroup\-props\-file\fR \fIfile\fR .RS 4 Same as \fB\-\-cgroup\-props\fR, except the specification is read from the \fIfile\fR\&. .RE .PP \fB\-\-cgroup\-dump\-controller\fR \fIname\fR .RS 4 Dump a controller with \fIname\fR only, skipping anything else that was discovered automatically (usually via \fB/proc\fR)\&. This option is useful when one needs \fBcriu\fR to skip some controllers\&. .RE .PP \fB\-\-cgroup\-yard\fR \fIpath\fR .RS 4 Instead of trying to mount cgroups in CRIU, provide a path to a directory with already created cgroup yard\&. Useful if you don\(cqt want to grant CAP_SYS_ADMIN to CRIU\&. For every cgroup mount there should be exactly one directory\&. If there is only one controller in this mount, the dir\(cqs name should be just the name of the controller\&. If there are multiple controllers comounted, the directory name should have them be separated by a comma\&. .sp For example, if \fB/proc/cgroups\fR looks like this: .sp .if n \{\ .RS 4 .\} .fam C .ps -1 .nf .BB lightgray #subsys_name hierarchy num_cgroups enabled cpu 1 1 1 devices 2 2 1 freezer 2 2 1 .EB lightgray .fi .fam .ps +1 .if n \{\ .RE .\} .sp then you can create the cgroup yard by the following commands: .sp .if n \{\ .RS 4 .\} .fam C .ps -1 .nf .BB lightgray mkdir private_yard cd private_yard mkdir cpu mount \-t cgroup \-o cpu none cpu mkdir devices,freezer mount \-t cgroup \-o devices,freezer none devices,freezer .EB lightgray .fi .fam .ps +1 .if n \{\ .RE .\} .RE .PP \fB\-\-tcp\-established\fR .RS 4 Checkpoint established TCP connections\&. .RE .PP \fB\-\-tcp\-close\fR .RS 4 Don\(cqt dump the state of, or block, established tcp connections (including the connection is once established but now closed)\&. This is useful when tcp connections are not going to be restored\&. .RE .PP \fB\-\-skip\-in\-flight\fR .RS 4 This option skips in\-flight TCP connections\&. If any TCP connections that are not yet completely established are found, \fBcriu\fR ignores these connections, rather than errors out\&. The TCP stack on the client side is expected to handle the re\-connect gracefully\&. .RE .PP \fB\-\-evasive\-devices\fR .RS 4 Use any path to a device file if the original one is inaccessible\&. .RE .PP \fB\-\-page\-server\fR .RS 4 Send pages to a page server (see the \fBpage\-server\fR command)\&. .RE .PP \fB\-\-force\-irmap\fR .RS 4 Force resolving names for inotify and fsnotify watches\&. .RE .PP \fB\-\-auto\-dedup\fR .RS 4 Deduplicate "old" data in pages images of previous \fBdump\fR\&. This option implies incremental \fBdump\fR mode (see the \fBpre\-dump\fR command)\&. .RE .PP \fB\-l\fR, \fB\-\-file\-locks\fR .RS 4 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\&. .RE .PP \fB\-\-link\-remap\fR .RS 4 Allows to link unlinked files back, if possible (modifies filesystem during \fBrestore\fR)\&. .RE .PP \fB\-\-timeout\fR \fInumber\fR .RS 4 Set a time limit in seconds for collecting tasks during the dump operation\&. The timeout is 10 seconds by default\&. .RE .PP \fB\-\-ghost\-limit\fR \fIsize\fR .RS 4 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 \fIsize\fR may be postfixed with a \fBK\fR, \fBM\fR or \fBG\fR, which stands for kilo\-, mega, and gigabytes, accordingly\&. .RE .PP \fB\-\-ghost\-fiemap\fR .RS 4 Enable an optimization based on fiemap ioctl that can reduce the number of system calls used when checkpointing highly sparse ghost files\&. This option is enabled by default, and it can be disabled with \fB\-\-no\-ghost\-fiemap\fR\&. An automatic fallback to SEEK_HOLE/SEEK_DATA is used when fiemap is not supported\&. .RE .PP \fB\-j\fR, \fB\-\-shell\-job\fR .RS 4 Allow one to dump shell jobs\&. This implies the restored task will inherit session and process group ID from the \fBcriu\fR itself\&. This option also allows to migrate a single external tty connection, to migrate applications like \fBtop\fR\&. If used with \fBdump\fR command, it must be specified with \fBrestore\fR as well\&. .RE .PP \fB\-\-cpu\-cap\fR [\fIcap\fR[,\fIcap\fR\&...]] .RS 4 Specify CPU capabilities to write to an image file\&. The argument is a comma\-separated list of: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBnone\fR to ignore capabilities at all; the image will not be produced on dump, neither any check performed on restore; .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBfpu\fR to check if FPU module is compatible; .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBins\fR to check if CPU supports all instructions required; .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBcpu\fR to check if CPU capabilities are exactly matching; .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBall\fR for all above set\&. .RE .sp By default the option is set to \fBfpu\fR and \fBins\fR\&. .RE .PP \fB\-\-cgroup\-root\fR [\fIcontroller\fR:]/\fInewroot\fR .RS 4 Change the root for the controller that will be dumped\&. By default, \fBcriu\fR 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\&. .RE .PP \fB\-\-lazy\-pages\fR .RS 4 Perform the dump procedure without writing memory pages into the image files and prepare to service page requests over the network\&. When \fBdump\fR runs in this mode it presumes that \fBlazy\-pages\fR 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 \fBrestore\fR with appropriate options\&. .RE .PP \fB\-\-file\-validation\fR [\fImode\fR] .RS 4 Set the method to be used to validate open files\&. Validation is done to ensure that the version of the file being restored is the same version when it was dumped\&. .sp The \fImode\fR may be one of the following: .PP \fBfilesize\fR .RS 4 To explicitly use only the file size check all the time\&. This is the fastest and least intensive check\&. .RE .PP \fBbuildid\fR .RS 4 To validate ELF files with their build\-ID\&. If the build\-ID cannot be obtained, \fIchksm\-first\fR method will be used\&. This is the default if mode is unspecified\&. .RE .RE .PP \fB\-\-network\-lock\fR [\fImode\fR] .RS 4 Set the method to be used for network locking/unlocking\&. Locking is done to ensure that tcp packets are dropped between dump and restore\&. This is done to avoid the kernel sending RST when a packet arrives destined for the dumped process\&. .sp The \fImode\fR may be one of the following: .PP \fBiptables\fR .RS 4 Use iptables rules to drop the packets\&. This is the default if \fImode\fR is not specified\&. .RE .PP \fBnftables\fR .RS 4 Use nftables rules to drop the packets\&. .RE .PP \fBskip\fR .RS 4 Don\(cqt lock the network\&. If \fB\-\-tcp\-close\fR is not used, the network must be locked externally to allow CRIU to dump TCP connections\&. .RE .RE .SS "restore" .sp Restores previously checkpointed processes\&. .PP \fB\-\-inherit\-fd\fR \fBfd[\fR\fIN\fR\fB]:\fR\fIresource\fR .RS 4 Inherit a file descriptor\&. This option lets \fBcriu\fR use an already opened file descriptor \fIN\fR for restoring a file identified by \fIresource\fR\&. This option can be used to restore an external resource dumped with the help of \fB\-\-external\fR \fBfile\fR, \fBtty\fR, \fBpid\fR and \fBunix\fR options\&. .sp The \fIresource\fR argument can be one of the following: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBtty[\fR\fIrdev\fR\fB:\fR\fIdev\fR\fB]\fR .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBpipe[\fR\fIinode\fR\fB]\fR .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBsocket[\fR\fIinode\fR*]* .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBfile[\fR\fImnt_id\fR\fB:\fR\fIinode\fR\fB]\fR .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fIpath/to/file\fR .RE .sp Note that square brackets used in this option arguments are literals and usually need to be escaped from shell\&. .RE .PP \fB\-d\fR, \fB\-\-restore\-detached\fR .RS 4 Detach \fBcriu\fR itself once restore is complete\&. .RE .PP \fB\-s\fR, \fB\-\-leave\-stopped\fR .RS 4 Leave tasks in stopped state after restore (rather than resuming their execution)\&. .RE .PP \fB\-S\fR, \fB\-\-restore\-sibling\fR .RS 4 Restore root task as a sibling (makes sense only with \fB\-\-restore\-detached\fR)\&. .RE .PP \fB\-\-log\-pid\fR .RS 4 Write separate logging files per each pid\&. .RE .PP \fB\-r\fR, \fB\-\-root\fR \fIpath\fR .RS 4 Change the root filesystem to \fIpath\fR (when run in a mount namespace)\&. This option is required to restore a mount namespace\&. The directory \fIpath\fR must be a mount point and its parent must not be overmounted\&. .RE .PP \fB\-\-external\fR \fItype\fR\fB[\fR\fIid\fR\fB]:\fR\fIvalue\fR .RS 4 Restore an instance of an external resource\&. The generic syntax is \fItype\fR of resource, followed by resource \fIid\fR (enclosed in literal square brackets), and optional \fIvalue\fR (prepended by a literal colon)\&. The following resource types are currently supported: \fBmnt\fR, \fBdev\fR, \fBveth\fR, \fBmacvlan\fR\&. Syntax depends on type\&. Note to restore external resources dealing with opened file descriptors (such as dumped with the help of \fB\-\-external\fR \fBfile\fR, \fBtty\fR, and \fBunix\fR options), option \fB\-\-inherit\-fd\fR should be used\&. .RE .PP \fB\-\-external\fR \fBmnt[\fR\fIname\fR\fB]:\fR\fImountpoint\fR .RS 4 Restore an external bind mount referenced in the image by \fIname\fR, bind\-mounting it from the host \fImountpoint\fR to a proper mount point\&. .RE .PP \fB\-\-external mnt[]\fR .RS 4 Restore all external bind mounts (dumped with the help of \fB\-\-external mnt[]\fR auto\-detection)\&. .RE .PP \fB\-\-external\fR \fBdev[\fR\fIname\fR\fB]:\fR\fI/dev/path\fR .RS 4 Restore an external mount device, identified in the image by \fIname\fR, using the existing block device \fI/dev/path\fR\&. .RE .PP \fB\-\-external\fR \fBveth[\fR\fIinner_dev\fR\fB]:\fR\fIouter_dev\fR\fB@\fR\fIbridge\fR .RS 4 Set the outer VETH device name (corresponding to \fIinner_dev\fR being restored) to \fIouter_dev\fR\&. If optional \fB@\fR\fIbridge\fR is specified, \fIouter_dev\fR is added to that bridge\&. If the option is not used, \fIouter_dev\fR will be autogenerated by the kernel\&. .RE .PP \fB\-\-external\fR \fBmacvlan[\fR\fIinner_dev\fR\fB]:\fR\fIouter_dev\fR .RS 4 When restoring an image that have a MacVLAN device in it, this option must be used to specify to which \fIouter_dev\fR (an existing network device in CRIU namespace) the restored \fIinner_dev\fR should be bound to\&. .RE .PP \fB\-J\fR, \fB\-\-join\-ns\fR \fBNS\fR:{\fBPID\fR|\fBNS_FILE\fR}[,\fBEXTRA_OPTS\fR] .RS 4 Restore process tree inside an existing namespace\&. The namespace can be specified in \fIPID\fR or \fINS_FILE\fR path format (example: \fB\-\-join\-ns net:12345\fR or \fB\-\-join\-ns net:/foo/bar\fR)\&. Currently supported values for \fBNS\fR are: \fBipc\fR, \fBnet\fR, \fBtime\fR, \fBuser\fR, and \fButs\fR\&. This option doesn\(cqt support joining a PID namespace, however, this is possible using \fB\-\-external\fR and \fB\-\-inheritfd\fR\&. \fIEXTRA_OPTS\fR is optional and can be used to specify UID and GID for user namespace (e\&.g\&., \fB\-\-join\-ns user:PID,UID,GID\fR)\&. .RE .PP \fB\-\-manage\-cgroups\fR [\fImode\fR] .RS 4 Restore cgroups configuration associated with a task from the image\&. Controllers are always restored in an optimistic way \(em if already present in system, \fBcriu\fR reuses it, otherwise it will be created\&. .sp The \fImode\fR may be one of the following: .PP \fBnone\fR .RS 4 Do not restore cgroup properties but require cgroup to pre\-exist at the moment of \fBrestore\fR procedure\&. .RE .PP \fBprops\fR .RS 4 Restore cgroup properties and require cgroup to pre\-exist\&. .RE .PP \fBsoft\fR .RS 4 Restore cgroup properties if only cgroup has been created by \fBcriu\fR, otherwise do not restore properties\&. This is the default if mode is unspecified\&. .RE .PP \fBfull\fR .RS 4 Always restore all cgroups and their properties\&. .RE .PP \fBstrict\fR .RS 4 Restore all cgroups and their properties from the scratch, requiring them to not present in the system\&. .RE .PP \fBignore\fR .RS 4 Don\(cqt deal with cgroups and pretend that they don\(cqt exist\&. .RE .RE .PP \fB\-\-cgroup\-yard\fR \fIpath\fR .RS 4 Instead of trying to mount cgroups in CRIU, provide a path to a directory with already created cgroup yard\&. For more information look in the \fBdump\fR section\&. .RE .PP \fB\-\-cgroup\-root\fR [\fIcontroller\fR\fB:\fR]/\fInewroot\fR .RS 4 Change the root cgroup the controller will be installed into\&. No controller means that root is the default for all controllers not specified\&. .RE .PP \fB\-\-tcp\-established\fR .RS 4 Restore previously dumped established TCP connections\&. This implies that the network has been locked between \fBdump\fR and \fBrestore\fR phases so other side of a connection simply notice a kind of lag\&. .RE .PP \fB\-\-tcp\-close\fR .RS 4 Restore connected TCP sockets in closed state\&. .RE .PP \fB\-\-veth\-pair\fR \fIIN\fR\fB=\fR\fIOUT\fR .RS 4 Correspondence between outside and inside names of veth devices\&. .RE .PP \fB\-l\fR, \fB\-\-file\-locks\fR .RS 4 Restore file locks from the image\&. .RE .PP \fB\-\-lsm\-profile\fR \fItype\fR\fB:\fR\fIname\fR .RS 4 Specify an LSM profile to be used during restore\&. The \fItype\fR can be either \fBapparmor\fR or \fBselinux\fR\&. .RE .PP \fB\-\-lsm\-mount\-context\fR \fIcontext\fR .RS 4 Specify a new mount context to be used during restore\&. .sp This option will only replace existing mount context information with the one specified with this option\&. Mounts without the \fIcontext=\fR option will not be changed\&. .sp If a mountpoint has been checkpointed with an option like .sp .if n \{\ .RS 4 .\} .fam C .ps -1 .nf .BB lightgray context="system_u:object_r:container_file_t:s0:c82,c137" .EB lightgray .fi .fam .ps +1 .if n \{\ .RE .\} .sp it is possible to change this option using .sp .if n \{\ .RS 4 .\} .fam C .ps -1 .nf .BB lightgray \-\-lsm\-mount\-context "system_u:object_r:container_file_t:s0:c204,c495" .EB lightgray .fi .fam .ps +1 .if n \{\ .RE .\} .sp which will result that the mountpoint will be restored with the new \fIcontext=\fR\&. .sp This option is useful if using \fBselinux\fR and if the \fBselinux\fR labels need to be changed on restore like if a container is restored into an existing Pod\&. .RE .PP \fB\-\-auto\-dedup\fR .RS 4 As soon as a page is restored it get punched out from image\&. .RE .PP \fB\-j\fR, \fB\-\-shell\-job\fR .RS 4 Restore shell jobs, in other words inherit session and process group ID from the criu itself\&. .RE .PP \fB\-\-cpu\-cap\fR [\fIcap\fR[,\fIcap\fR\&...]] .RS 4 Specify CPU capabilities to be present on the CPU the process is restoring\&. To inverse a capability, prefix it with \fB^\fR\&. This option implies that \fB\-\-cpu\-cap\fR has been passed on \fBdump\fR as well, except \fBfpu\fR option case\&. The \fIcap\fR argument can be the following (or a set of comma\-separated values): .PP \fBall\fR .RS 4 Require all capabilities\&. This is \fBdefault\fR mode if \fB\-\-cpu\-cap\fR is passed without arguments\&. Most safe mode\&. .RE .PP \fBcpu\fR .RS 4 Require the CPU to have all capabilities in image to match runtime CPU\&. .RE .PP \fBfpu\fR .RS 4 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 \fBdefault\fR mode if \fB\-\-cpu\-cap\fR is not present in command line\&. Note this argument might be passed even if on the \fBdump\fR no \fB\-\-cpu\-cap\fR have been specified because FPU frames are always encoded into images\&. .RE .PP \fBins\fR .RS 4 Require CPU compatibility on instructions level\&. .RE .PP \fBnone\fR .RS 4 Ignore capabilities\&. Most dangerous mode\&. The behaviour is implementation dependent\&. Try to not use it until really required\&. .sp For example, this option can be used in case \fB\-\-cpu\-cap=cpu\fR was used during \fBdump\fR, and images are migrated to a less capable CPU and are to be restored\&. By default, \fBcriu\fR shows an error that CPU capabilities are not adequate, but this can be suppressed by using \fB\-\-cpu\-cap=none\fR\&. .RE .RE .PP \fB\-\-weak\-sysctls\fR .RS 4 Silently skip restoring sysctls that are not available\&. This allows to restore on an older kernel, or a kernel configured without some options\&. .RE .PP \fB\-\-lazy\-pages\fR .RS 4 Restore the processes without filling out the entire memory contents\&. When this option is used, \fBrestore\fR 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 \fBlazy\-pages\fR daemon\&. .RE .PP \fB\-\-file\-validation\fR [\fImode\fR] .RS 4 Set the method to be used to validate open files\&. Validation is done to ensure that the version of the file being restored is the same version when it was dumped\&. .sp The \fImode\fR may be one of the following: .PP \fBfilesize\fR .RS 4 To explicitly use only the file size check all the time\&. This is the fastest and least intensive check\&. .RE .PP \fBbuildid\fR .RS 4 To validate ELF files with their build\-ID\&. If the build\-ID cannot be obtained, \fIchksm\-first\fR method will be used\&. This is the default if mode is unspecified\&. .RE .RE .PP \fB\-\-skip\-file\-rwx\-check\fR .RS 4 Skip checking file permissions (r/w/x for u/g/o) on restore\&. .RE .SS "check" .sp Checks whether the kernel supports the features needed by \fBcriu\fR to dump and restore a process tree\&. .sp 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\&. .PP \fBCategory 1\fR .RS 4 Absolutely required\&. These are features like support for \fB/proc/PID/map_files\fR, \fBNETLINK_SOCK_DIAG\fR socket monitoring, \fB/proc/sys/kernel/ns_last_pid\fR etc\&. .RE .PP \fBCategory 2\fR .RS 4 Required only for specific cases\&. These are features like AIO remap, \fB/dev/net/tun\fR and others that are only required if a process being dumped or restored is using those\&. .RE .PP \fBCategory 3\fR .RS 4 Experimental\&. These are features like \fBtask\-diag\fR that are used for experimental purposes (mostly during development)\&. .RE .sp If there are no errors or warnings, \fBcriu\fR prints "Looks good\&." and its exit code is 0\&. .sp A missing Category 1 feature causes \fBcriu\fR to print "Does not look good\&." and its exit code is non\-zero\&. .sp Missing Category 2 and 3 features cause \fBcriu\fR to print "Looks good but \&..." and its exit code is be non\-zero\&. .sp Without any options, \fBcriu check\fR checks Category 1 features\&. This behavior can be changed by using the following options: .PP \fB\-\-extra\fR .RS 4 Check kernel support for Category 2 features\&. .RE .PP \fB\-\-experimental\fR .RS 4 Check kernel support for Category 3 features\&. .RE .PP \fB\-\-all\fR .RS 4 Check kernel support for Category 1, 2, and 3 features\&. .RE .PP \fB\-\-feature\fR \fIname\fR .RS 4 Check a specific feature\&. If \fIname\fR is \fBlist\fR, a list of valid kernel feature names that can be checked will be printed\&. .RE .SS "page\-server" .sp Launches \fBcriu\fR in page server mode\&. .PP \fB\-\-daemon\fR .RS 4 Runs page server as a daemon (background process)\&. .RE .PP \fB\-\-status\-fd\fR .RS 4 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\&. .RE .PP \fB\-\-address\fR \fIaddress\fR .RS 4 Page server IP address or hostname\&. .RE .PP \fB\-\-port\fR \fInumber\fR .RS 4 Page server port number\&. .RE .PP \fB\-\-ps\-socket\fR \fIfd\fR .RS 4 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\&. .RE .PP \fB\-\-lazy\-pages\fR .RS 4 Serve local memory dump to a remote \fBlazy\-pages\fR daemon\&. In this mode the \fBpage\-server\fR reads local memory dump and allows the remote \fBlazy\-pages\fR daemon to request memory pages in random order\&. .RE .PP \fB\-\-tls\-cacert\fR \fIfile\fR .RS 4 Specifies the path to a trusted Certificate Authority (CA) certificate file to be used for verification of a client or server certificate\&. The \fIfile\fR must be in PEM format\&. When this option is used only the specified CA is used for verification\&. Otherwise, the system\(cqs trusted CAs and, if present, \fI/etc/pki/CA/cacert\&.pem\fR will be used\&. .RE .PP \fB\-\-tls\-cacrl\fR \fIfile\fR .RS 4 Specifies a path to a Certificate Revocation List (CRL) \fIfile\fR which contains a list of revoked certificates that should no longer be trusted\&. The \fIfile\fR must be in PEM format\&. When this option is not specified, the file, if present, \fI/etc/pki/CA/cacrl\&.pem\fR will be used\&. .RE .PP \fB\-\-tls\-cert\fR \fIfile\fR .RS 4 Specifies a path to a file that contains a X\&.509 certificate to present to the remote entity\&. The \fIfile\fR must be in PEM format\&. When this option is not specified, the default location (\fI/etc/pki/criu/cert\&.pem\fR) will be used\&. .RE .PP \fB\-\-tls\-key\fR \fIfile\fR .RS 4 Specifies a path to a file that contains TLS private key\&. The \fIfile\fR must be in PEM format\&. When this option is not the default location (\fI/etc/pki/criu/private/key\&.pem\fR) will be used\&. .RE .PP \fB\-\-tls\fR .RS 4 Use TLS to secure remote connections\&. .RE .SS "lazy\-pages" .sp Launches \fBcriu\fR in lazy\-pages daemon mode\&. .sp 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\&. .SS "exec" .sp Executes a system call inside a destination task\*(Aqs context\&. This functionality is deprecated; please use \fBCompel\fR instead\&. .SS "service" .sp 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\&. .SS "dedup" .sp 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\&. .SS "cpuinfo dump" .sp Fetches current CPU features and write them into an image file\&. .SS "cpuinfo check" .sp 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\&. .SH "CONFIGURATION FILES" .sp \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\&. .sp The options passed to CRIU via CLI, RPC or configuration file are evaluated in the following order: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} apply_config(/etc/criu/default\&.conf) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} apply_config($HOME/\&.criu/default\&.conf) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} apply_config(CRIU_CONFIG_FILE) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} apply_config(\fB\-\-config\fR \fIfile\fR) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} apply_config(CLI) or apply_config(RPC) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} apply_config(RPC configuration file) (only for RPC mode) .RE .sp 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\&. .SS "Configuration file syntax" .sp 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\&. .sp Example of configuration file to illustrate syntax: .sp .if n \{\ .RS 4 .\} .fam C .ps -1 .nf .BB lightgray $ cat ~/\&.criu/default\&.conf tcp\-established work\-dir "/home/USERNAME/criu/my \e"work\e" directory" #this is a comment no\-restore\-sibling # this is another comment .EB lightgray .fi .fam .ps +1 .if n \{\ .RE .\} .SS "Configuration files in RPC mode" .sp 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\&. .sp 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 .SH "NON\-ROOT" .sp \fBcriu\fR can be used as non\-root with either the \fBCAP_SYS_ADMIN\fR capability or with the \fBCAP_CHECKPOINT_RESTORE\fR capability introduces in Linux kernel 5\&.9\&. \fBCAP_CHECKPOINT_RESTORE\fR is the minimum that is required\&. .sp \fBcriu\fR also needs either \fBCAP_SYS_PTRACE\fR or a value of 0 in \fB/proc/sys/kernel/yama/ptrace_scope\fR (see \fBptrace\fR(2)) to be able to interrupt the process for dumping\&. .sp Running \fBcriu\fR as non\-root has many limitations and depending on the process to checkpoint and restore it may not be possible\&. .sp In addition to \fBCAP_CHECKPOINT_RESTORE\fR it is possible to give \fBcriu\fR additional capabilities to enable additional features in non\-root mode\&. .sp Currently \fBcriu\fR can benefit from the following additional capabilities: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBCAP_NET_ADMIN\fR .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBCAP_SYS_CHROOT\fR .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBCAP_SETUID\fR .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBCAP_SYS_RESOURCE\fR .RE .sp Note that for some operations, having a capability in a namespace other than the init namespace (i\&.e\&. the default/root namespace) is not sufficient\&. For example, in order to read symlinks in proc/[pid]/map_files CRIU requires CAP_CHECKPOINT_RESTORE in the init namespace; having CAP_CHECKPOINT_RESTORE while running in another user namespace (e\&.g\&. in a container) does not allow CRIU to read symlinks in /proc/[pid]/map_files\&. .sp Without access to /proc/[pid]/map_files checkpointing/restoring processes that have mapped deleted files may not be possible\&. .sp Independent of the capabilities it is always necessary to use "\fB\-\-unprivileged\fR" to accept \fBcriu\fR\*(Aqs limitation in non\-root mode\&. .SH "EXAMPLES" .sp To checkpoint a program with pid of \fB1234\fR and write all image files into directory \fBcheckpoint\fR: .sp .if n \{\ .RS 4 .\} .fam C .ps -1 .nf .BB lightgray criu dump \-D checkpoint \-t 1234 .EB lightgray .fi .fam .ps +1 .if n \{\ .RE .\} .sp To restore this program detaching criu itself: .sp .if n \{\ .RS 4 .\} .fam C .ps -1 .nf .BB lightgray criu restore \-d \-D checkpoint .EB lightgray .fi .fam .ps +1 .if n \{\ .RE .\} .SH "AUTHOR" .sp The CRIU team\&. .SH "COPYRIGHT" .sp Copyright (C) 2011\-2016, Parallels Holdings, Inc\&.