[CRIU] [PATCH v2 3/4] Add documentation for configuration files

vkabatov at redhat.com vkabatov at redhat.com
Wed May 24 07:18:09 PDT 2017


From: Veronika Kabatova <vkabatov at redhat.com>

Signed-off-by: Veronika Kabatova <vkabatov at redhat.com>
---
 Documentation/criu.txt | 33 +++++++++++++++++++++++++++++++++
 criu/crtools.c         |  4 ++++
 2 files changed, 37 insertions(+)

diff --git a/Documentation/criu.txt b/Documentation/criu.txt
index dfd6ebc..9542a34 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,33 @@ 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 using 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.d/default.conf' and '$HOME/.criu.d/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). Usage of commands is disallowed.
+
+Example of configuration file to illustrate syntax:
+---------------
+$ cat ~/.criu.d/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 aee020f..dc8546a 100644
--- a/criu/crtools.c
+++ b/criu/crtools.c
@@ -1158,6 +1158,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