[CRIU] [PATCH 3/4 v4] Add documentation for configuration files
vkabatov at redhat.com
vkabatov at redhat.com
Fri Jun 16 18:17:20 MSK 2017
From: Veronika Kabatova <vkabatov at redhat.com>
Signed-off-by: Veronika Kabatova <vkabatov at redhat.com>
---
Documentation/criu.txt | 37 +++++++++++++++++++++++++++++++++++++
criu/crtools.c | 4 ++++
2 files changed, 41 insertions(+)
diff --git a/Documentation/criu.txt b/Documentation/criu.txt
index dfd6ebc..11c7055 100644
--- a/Documentation/criu.txt
+++ b/Documentation/criu.txt
@@ -53,6 +53,12 @@ The following levels are available:
* *-v4*
above plus lots of debug.
+*--config* 'file'::
+ Pass a specific configuration file to criu.
+
+*--no-default-config*::
+ Forbid parsing of default configuration files.
+
*--pidfile* 'file'::
Write root task, service or page-server pid into a 'file'.
@@ -607,6 +613,37 @@ Fetches current CPU features (i.e. CPU the *criu* is running on) and test if
they are compatible with the ones present in an image file.
+CONFIGURATION FILES
+-------------------
+Criu 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
+"*--config* 'file'" option. If no file is passed, default configuration files
+'/etc/criu/default.conf' and '$HOME/.criu/default.conf' are parsed (if
+present on the system). Default configuration file parsing can be forbidden
+with "*--no-default-config*" if needed. Parsed configuration files are merged
+with command line options, which allows overriding boolean options.
+
+Configuration file syntax
+~~~~~~~~~~~~~~~~~~~~~~~~~
+Comments are supported using \'#' sign. The rest of the line is ignored.
+Options are the same as command line options without the \'--' 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 \'\' sign. Usage of commands is disallowed and all other escape sequences
+are interpreted literally.
+
+Example of configuration file to illustrate syntax:
+---------------
+$ cat ~/.criu/default.conf
+tcp-established
+work-dir "/home/USERNAME/criu/my \"work\" directory"
+#this is a comment
+no-restore-sibling # this is another comment
+---------------
+
EXAMPLES
--------
To checkpoint a program with pid of *1234* and write all image files into
diff --git a/criu/crtools.c b/criu/crtools.c
index 34850b3..cb97f08 100644
--- a/criu/crtools.c
+++ b/criu/crtools.c
@@ -1197,6 +1197,10 @@ usage:
" --status-fd FD write \\0 to the FD and close it once process is ready\n"
" to handle requests\n"
"\n"
+"Configuration file options:\n"
+" --config FILEPATH pass a specific configuration file\n"
+" --no-default-config forbid usage of default configuration files\n"
+"\n"
"Other options:\n"
" -h|--help show this text\n"
" -V|--version show version\n"
--
2.7.4
More information about the CRIU
mailing list