2013-05-01 20:21:50 -07:00
|
|
|
CRIU(8)
|
2013-05-01 20:21:47 -07:00
|
|
|
=======
|
2012-01-28 18:45:28 +04:00
|
|
|
:doctype: manpage
|
2013-05-01 20:21:47 -07:00
|
|
|
:man source: criu
|
2012-10-18 19:47:17 +04:00
|
|
|
:man version: 0.0.2
|
2013-05-01 20:21:47 -07:00
|
|
|
:man manual: CRIU Manual
|
2012-01-28 18:45:28 +04:00
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
2013-05-01 20:21:47 -07:00
|
|
|
criu - checkpoint/restore in userspace
|
2012-01-28 18:45:28 +04:00
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
2013-05-01 20:21:58 -07:00
|
|
|
*criu* 'command' ['options']
|
2012-01-28 18:45:28 +04:00
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
2013-05-01 20:21:51 -07:00
|
|
|
*criu* is command line utility to steer checkpoint and restore procedure.
|
2012-01-28 18:45:28 +04:00
|
|
|
|
2013-05-01 20:21:52 -07:00
|
|
|
The 'command' can be one of the following:
|
|
|
|
|
|
|
|
*dump*::
|
|
|
|
Initiate checkpoint procedure.
|
|
|
|
|
|
|
|
*restore*::
|
|
|
|
Restore previously checkpointed processes.
|
|
|
|
|
|
|
|
*show*::
|
|
|
|
Decode own binary dump files and show their contents in human-readable form.
|
|
|
|
|
|
|
|
*check*::
|
|
|
|
Test whether the kernel support is up-to-date.
|
|
|
|
|
|
|
|
*page-server*::
|
|
|
|
Launch a page server.
|
|
|
|
|
|
|
|
*exec*::
|
|
|
|
Execute a system call from other task\'s context.
|
|
|
|
|
2012-01-28 18:45:28 +04:00
|
|
|
OPTIONS
|
|
|
|
-------
|
2013-05-01 20:21:53 -07:00
|
|
|
*-c*::
|
2013-05-01 20:21:51 -07:00
|
|
|
In case of *show* command the dumped pages content will be shown in hex format.
|
2012-01-28 18:45:28 +04:00
|
|
|
|
2013-05-01 20:21:53 -07:00
|
|
|
*-D*, *--images-dir* 'path'::
|
2012-01-28 18:45:28 +04:00
|
|
|
Use path 'path' as a base directory where to look for dump files set. This
|
2013-05-01 20:21:55 -07:00
|
|
|
commands applies to any 'command'.
|
2012-01-28 18:45:28 +04:00
|
|
|
|
2013-05-01 20:21:53 -07:00
|
|
|
*-s*, *--leave-stopped*::
|
2012-04-16 20:36:00 +04:00
|
|
|
Leave tasks in stopped state after checkpoint instead of killing them.
|
|
|
|
|
2013-05-01 20:21:53 -07:00
|
|
|
*-f*, *--file* 'file'::
|
2013-05-01 20:21:51 -07:00
|
|
|
This option is valid for *show* command only and allows to see content of
|
2013-05-01 20:21:54 -07:00
|
|
|
the 'file' specified.
|
2012-01-28 18:45:28 +04:00
|
|
|
|
2013-05-01 20:21:53 -07:00
|
|
|
*-x*, *--ext-unix-sk*::
|
2012-07-23 07:08:48 +04:00
|
|
|
Dump external unix sockets.
|
|
|
|
|
2013-05-01 20:21:53 -07:00
|
|
|
*-t*, *--tree* 'pid'::
|
2012-01-28 18:45:28 +04:00
|
|
|
Checkpoint the whole process tree starting from 'pid'.
|
|
|
|
|
2013-05-01 20:21:53 -07:00
|
|
|
*-d*, *--restore-detached*::
|
2013-05-01 20:21:51 -07:00
|
|
|
Detach *criu* itself once restore is complete.
|
2012-01-29 00:39:57 +04:00
|
|
|
|
2013-05-01 20:21:53 -07:00
|
|
|
*-n*, *--namespaces* 'ns'[,'ns'...]::
|
2012-01-31 22:28:40 +04:00
|
|
|
Checkpoint namespaces. Namespaces must be separated by comma.
|
2013-02-18 17:54:46 +04:00
|
|
|
Currently supported namespaces: *uts*, *ipc*, *mnt*, *pid*, *net*.
|
2012-01-29 00:39:57 +04:00
|
|
|
|
2013-05-01 20:21:53 -07:00
|
|
|
*-r*, *--root* 'path'::
|
2012-09-19 17:04:27 +04:00
|
|
|
Change the root filesystem (when run in mount namespace).
|
|
|
|
|
2013-05-01 20:21:53 -07:00
|
|
|
*--evasive-devices*::
|
2012-09-19 17:04:27 +04:00
|
|
|
Use any path to a device file if the original one is inaccessible.
|
|
|
|
|
2013-05-01 20:21:53 -07:00
|
|
|
*--veth-pair* 'IN'*=*'OUT'::
|
2012-09-19 17:04:27 +04:00
|
|
|
Correspondence between outside and inside names of veth devices.
|
|
|
|
|
2013-05-01 20:21:53 -07:00
|
|
|
*--action-script* 'SCRIPT'::
|
2012-09-19 17:04:27 +04:00
|
|
|
Add an external action script.
|
2013-05-02 22:48:07 +04:00
|
|
|
The environment variable *CRTOOLS_SCRIPT_ACTION* contains one of the
|
2012-09-19 17:04:27 +04:00
|
|
|
actions:
|
2013-05-01 20:21:51 -07:00
|
|
|
* *network-lock*
|
2012-09-19 17:04:27 +04:00
|
|
|
lock network in a target network namespace
|
|
|
|
|
2013-05-01 20:21:51 -07:00
|
|
|
* *network-unlock*
|
2012-09-19 17:04:27 +04:00
|
|
|
unlock network in a target network namespace
|
|
|
|
|
2013-05-01 20:21:53 -07:00
|
|
|
*--link-remap*::
|
2012-10-18 19:47:17 +04:00
|
|
|
Allow to link unlinked files back when possible (modifies FS
|
|
|
|
till restore).
|
|
|
|
|
2013-05-01 20:21:53 -07:00
|
|
|
*-o*, *--log-file* 'file'::
|
2012-01-29 00:39:57 +04:00
|
|
|
Write logging messages to 'file'.
|
2012-01-28 18:45:28 +04:00
|
|
|
|
2013-05-01 20:21:53 -07:00
|
|
|
*-v* 'num'::
|
2013-05-01 20:21:57 -07:00
|
|
|
Set logging level to 'num'. Valid arguments are:
|
|
|
|
* *0* - (silent, error messages only);
|
|
|
|
* *1* - informative (default);
|
|
|
|
* *2* - debug messages.
|
2012-02-17 22:51:23 +04:00
|
|
|
|
2013-05-01 20:21:53 -07:00
|
|
|
*--log-pid*::
|
2012-07-23 07:08:48 +04:00
|
|
|
Write separate logging files per each pid.
|
|
|
|
|
2013-05-01 20:21:53 -07:00
|
|
|
*--close* 'fd'::
|
2012-07-23 07:08:48 +04:00
|
|
|
Close file with descriptor 'fd' before anything else.
|
|
|
|
|
2013-05-01 20:21:53 -07:00
|
|
|
*--tcp-established*::
|
2012-07-23 07:08:48 +04:00
|
|
|
Checkpoint/restore established TCP connections.
|
|
|
|
|
2013-05-01 20:21:53 -07:00
|
|
|
*-j*, *--shell-job*::
|
2012-10-18 19:47:17 +04:00
|
|
|
Allow to dump and restore shell jobs. This implies the restored task
|
2013-05-01 20:21:47 -07:00
|
|
|
will inherit session and process group ID from the criu itself.
|
2012-10-18 19:47:17 +04:00
|
|
|
Also this option allows to migrate a single external tty connection, in other
|
2013-05-01 20:21:54 -07:00
|
|
|
words this option allows to migrate such application as *top* and friends.
|
2012-10-18 19:47:17 +04:00
|
|
|
|
2013-05-01 20:21:53 -07:00
|
|
|
*-l*, *--file-locks*::
|
2013-05-01 20:21:56 -07:00
|
|
|
Allow to dump and restore 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
|
2013-04-30 20:08:57 +04:00
|
|
|
for a container dump/restore.
|
2013-01-17 16:09:35 +08:00
|
|
|
|
2013-05-01 20:21:53 -07:00
|
|
|
*--ms*::
|
2013-04-30 20:08:56 +04:00
|
|
|
In case of *check* command does not try to check for features which are
|
|
|
|
known to be not yet merged upstream.
|
|
|
|
|
2013-05-01 20:21:53 -07:00
|
|
|
*--page-server*::
|
2013-04-30 20:08:55 +04:00
|
|
|
In case of *dump* command sends pages to a page server.
|
|
|
|
|
2013-05-01 20:21:53 -07:00
|
|
|
*--address*::
|
2013-04-30 20:08:55 +04:00
|
|
|
Page server address.
|
|
|
|
|
2013-05-01 20:21:53 -07:00
|
|
|
*--port*::
|
2013-04-30 20:08:55 +04:00
|
|
|
Page server port number.
|
|
|
|
|
2013-05-01 20:21:53 -07:00
|
|
|
*-V, *--version*::
|
2012-07-23 07:08:48 +04:00
|
|
|
Print program version.
|
|
|
|
|
2013-05-01 20:21:53 -07:00
|
|
|
*-h*, *--help*::
|
2012-07-23 07:08:48 +04:00
|
|
|
Print inline help.
|
|
|
|
|
2012-12-18 00:39:20 +03:00
|
|
|
SYSCALLS EXECUTION
|
|
|
|
------------------
|
|
|
|
|
2013-01-25 14:58:09 +04:00
|
|
|
To run a system call from another task\'s context use
|
2012-12-18 00:39:20 +03:00
|
|
|
|
2013-05-01 20:21:51 -07:00
|
|
|
criu exec -t pid syscall-string
|
2012-12-18 00:39:20 +03:00
|
|
|
|
2013-05-01 20:21:51 -07:00
|
|
|
command. The 'syscall-string' should look like
|
2012-12-18 00:39:20 +03:00
|
|
|
|
2013-05-01 20:21:51 -07:00
|
|
|
syscall-name syscall-arguments ...
|
2012-12-18 00:39:20 +03:00
|
|
|
|
|
|
|
Each command line argument is transformed into the system call argument by
|
|
|
|
the following rules:
|
|
|
|
|
2013-05-01 20:21:51 -07:00
|
|
|
* If one starts with *&*, the rest of it gets copied to the target task\'s
|
2012-12-18 00:39:20 +03:00
|
|
|
address space and the respective syscall argument is the pointer to this
|
|
|
|
string;
|
|
|
|
|
2013-05-01 20:21:56 -07:00
|
|
|
* Otherwise it is treated as a number (converted with strtol) and is directly
|
2012-12-18 00:39:20 +03:00
|
|
|
passed into the system call.
|
|
|
|
|
2012-07-23 07:09:39 +04:00
|
|
|
EXAMPLES
|
|
|
|
--------
|
|
|
|
|
2013-05-01 20:21:59 -07:00
|
|
|
To checkpoint a program with pid of *1234* and write all image files into
|
|
|
|
directory *checkpoint*:
|
2012-07-23 07:09:39 +04:00
|
|
|
|
2013-05-01 20:21:47 -07:00
|
|
|
criu dump -D checkpoint -t 1234
|
2012-07-23 07:09:39 +04:00
|
|
|
|
2013-05-01 20:21:59 -07:00
|
|
|
To restore this program detaching criu itself:
|
2012-07-23 07:09:39 +04:00
|
|
|
|
2013-05-01 20:21:47 -07:00
|
|
|
criu restore -d -D checkpoint -t 1234
|
2012-07-23 07:09:39 +04:00
|
|
|
|
2012-12-18 00:39:20 +03:00
|
|
|
|
2013-05-01 20:21:59 -07:00
|
|
|
To close a file descriptor number *1* in task with pid *1234*:
|
2012-12-18 00:39:20 +03:00
|
|
|
|
2013-05-01 20:21:47 -07:00
|
|
|
criu exec -t 1234 close 1
|
2012-12-18 00:39:20 +03:00
|
|
|
|
2013-05-01 20:21:51 -07:00
|
|
|
To open a file named */foo/bar* for read-write in the task with pid
|
2013-05-01 20:21:59 -07:00
|
|
|
*1234*:
|
2012-12-18 00:39:20 +03:00
|
|
|
|
2013-05-01 20:21:47 -07:00
|
|
|
criu exec -t 1234 open '&/foo/bar' 2
|
2012-12-18 00:39:20 +03:00
|
|
|
|
|
|
|
|
2012-01-28 18:45:28 +04:00
|
|
|
AUTHOR
|
|
|
|
------
|
|
|
|
OpenVZ team.
|
|
|
|
|
2013-05-01 20:21:49 -07:00
|
|
|
COPYRIGHT
|
|
|
|
---------
|
|
|
|
Copyright \(C) 2011-2013, Parallels Inc.
|