[v2,3/4] Add documentation for configuration files

Submitted by Veronika Kabatova on May 24, 2017, 2:18 p.m.


Message ID 1495635490-22818-4-git-send-email-vkabatov@redhat.com
State New
Series "Implementation of configuration files"
Headers show

Commit Message

Veronika Kabatova May 24, 2017, 2:18 p.m.
From: Veronika Kabatova <vkabatov@redhat.com>

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

Patch hide | download patch | download mbox

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.
+    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.
+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
+work-dir /home/USERNAME/criu/my_work_directory
+#this is a comment
+no-restore-sibling   # this is another comment
 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"
+"Configuration file options:\n"
+"  --config FILEPATH     pass a specific configuration file\n"
+"  --no-default-config   forbid usage of default configuration files\n"
 "Other options:\n"
 "  -h|--help             show this text\n"
 "  -V|--version          show version\n"