Difference between revisions of "CLI"

From CRIU
Jump to navigation Jump to search
(→‎Further reading: rename, add link to howto)
(crtools -> criu)
Line 3: Line 3:
 
== Synopsis ==
 
== Synopsis ==
 
<pre>
 
<pre>
'crtools' <command> -t <pid> [<options>]
+
criu <command> -t <pid> [<options>]
 
</pre>
 
</pre>
  
 
== Description ==
 
== Description ==
'crtools' is command line utility to steer checkpoint and restore procedure.
+
criu is command line utility to steer checkpoint and restore procedure.
  
 
== Options ==
 
== Options ==
Line 43: Line 43:
  
 
-d::
 
-d::
     Detach 'crtools' itself once restore is complete.
+
     Detach criu itself once restore is complete.
  
 
-n <ns>::
 
-n <ns>::
Line 62: Line 62:
  
 
<pre>
 
<pre>
# crtools dump -D checkpoint -t 1234
+
# criu dump -D checkpoint -t 1234
 
</pre>
 
</pre>
  
To restore this program detaching crtools itself, one should type
+
To restore this program detaching criu itself, one should type
  
 
<pre>
 
<pre>
crtools restore -d -D checkpoint -t 1234
+
criu restore -d -D checkpoint -t 1234
 
</pre>
 
</pre>
  
"Detaching" (the <code>-d</code> option) here means, that crtools will exit after restoring the processes
+
"Detaching" (the <code>-d</code> option) here means, that criu will exit after restoring the processes
 
and the latter will get re-parent-ed to the init task.
 
and the latter will get re-parent-ed to the init task.
  
Line 77: Line 77:
  
 
<pre>
 
<pre>
crtools exec -t 1234 close 1
+
criu exec -t 1234 close 1
 
</pre>
 
</pre>
  
Line 83: Line 83:
  
 
<pre>
 
<pre>
crtools exec -t 1234 open '&/foo/bar' 2
+
criu exec -t 1234 open '&/foo/bar' 2
 
</pre>
 
</pre>
  

Revision as of 16:35, 30 April 2013

Since the tools and overall concept are still under heavy development, there are some known limitations applied, in particular only pure x86-64 environment is supported, no IA32 emulation allowed.

Synopsis

criu <command> -t <pid> [<options>]

Description

criu is command line utility to steer checkpoint and restore procedure.

Options

<command>::
    One of the follwong commands
        * 'dump'
                to initiate checkpoint procedure
        * 'restore'
                to restore previously checkpointed processes
        * 'show'
                to decode binary dump files and show their contents in human
                readable format
        * 'check'
                to test whether the kernel support is up-to-date
        * 'exec'
                to execute a system call from another task's context

-c::
    In case of 'show' command the dumped pages content will be shown in hex format.

-D <path>::
    Use path 'path' as a base directory where to look for dump files set. This
    commands allpies to any <command>.

-s::
    Leave tasks in stopped state after checkpoint instead of killing them.

-f <file>::
    This option is valid for 'show' command only and allows to see content of
    the <file> specified.

-t <pid>::
    Checkpoint the whole process tree starting from 'pid'.

-d::
    Detach criu itself once restore is complete.

-n <ns>::
    Checkpoint namespaces. Namespaces must be separated by comma.
    We now support all namespaces -- uts, ipc, net and mnt

-o <file>::
    Write logging messages to 'file'.

-v <num>::
    Set logging level to 'num'. Valid options are: 0 - (silent, error messages
    only), 1 - informative (default), 2 - debug messages.

Examples

To checkpoint a program with pid 1234 and write all image files into directory checkpoint one should type

# criu dump -D checkpoint -t 1234

To restore this program detaching criu itself, one should type

criu restore -d -D checkpoint -t 1234

"Detaching" (the -d option) here means, that criu will exit after restoring the processes and the latter will get re-parent-ed to the init task.

To close a file descriptor number 1 in task with pid 1234 run

criu exec -t 1234 close 1

To open a file named /foo/bar for read-write in the task with pid 1234 run

criu exec -t 1234 open '&/foo/bar' 2

See also