Changes

Jump to navigation Jump to search
296 bytes added ,  14:58, 2 August 2018
no edit summary
Line 1: Line 1: −
== This Page Is Work In Progress - Not Ready - Not Merged into master ==
     −
Many of CRIU's command-line options can also be influenced via configuration files. Configuration files are evaluated in [[CLI]] and [[RPC]] mode. It is important to know that configuration files are evaluated before the options set via CLI or RPC. This means that whatever is configured in the configuration files will be overwritten by explicitly set values via CLI or RPC.
+
Many of CRIU's command-line options can also be influenced via configuration files. Configuration files are evaluated in [[CLI]] and [[RPC]] mode. It is important to know that configuration files are evaluated before the options set via CLI or RPC (except for the RPC configuration file). This means that whatever is configured in the configuration files will be overwritten by explicitly set values via CLI or RPC.
    
=== Configuration File Location ===
 
=== Configuration File Location ===
The default configuration files parsed by CRIU, it they are present on the system, are first <code>/etc/criu/default.conf</code> and then <code>$HOME/.criu/default.conf</code>. Settings in the file <code>/etc/criu/default.conf</code> are overridden by settings in <code>$HOME/.criu/default.conf</code>.
+
The default configuration files parsed by CRIU, if they are present on the system, are first <code>/etc/criu/default.conf</code> and then <code>$HOME/.criu/default.conf</code>. Settings in the file <code>/etc/criu/default.conf</code> are overridden by settings in <code>$HOME/.criu/default.conf</code>. CRIU also evaluates the configuration file specified via <code>CRIU_CONFIG_FILE</code>.
    
Without any additional parameters CRIU configuration file parsing works like this:
 
Without any additional parameters CRIU configuration file parsing works like this:
Line 10: Line 9:  
# <code>/etc/criu/default.conf</code>; these values can be overridden by
 
# <code>/etc/criu/default.conf</code>; these values can be overridden by
 
# <code>$HOME/.criu/default.conf</code>; these values can be overridden by
 
# <code>$HOME/.criu/default.conf</code>; these values can be overridden by
 +
# <code>CRIU_CONFIG_FILE</code>; these values can be overridden by
 +
# <code>--config FILENAME</code>; these values can be overridden by
 
# CLI or RPC configuration options
 
# CLI or RPC configuration options
 +
# RPC configuration file (only in RPC mode)
   −
The user can tell CRIU to completely ignore any configuration file in one of the default locations with the <code>--no-default-config</code> option. In this case the user can still tell CRIU to use a configuration file with the <code>--config FILENAME</code> option. CRIU also honours the environment variable <code>CRIU_CONFIG_FILE</code> just as <code>--config FILENAME</code> option.
+
The user can tell CRIU to completely ignore configuration files in one of the default locations (/etc or $HOME) with the <code>--no-default-config</code> option. In this case the user can still tell CRIU to use a configuration file with the <code>--config FILENAME</code> option. CRIU also honours the environment variable <code>CRIU_CONFIG_FILE</code> just as <code>--config FILENAME</code> option.
    
=== Configuration File Syntax ===
 
=== Configuration File Syntax ===
Line 25: Line 27:     
=== Configuration Files in RPC Mode ===
 
=== Configuration Files in RPC Mode ===
As configuration file settings are overridden by CLI and RPC mode, there is a special RPC options which lets configuration file settings override RPC settings. This is different than the normal sequence and can lead to situation which break the RPC client -> CRIU setup. As this can lead to broken setups the RPC client has to explicitly enable this mode: <code>opts.prefer_config_file = True</code>.
+
As configuration file settings are overridden by CLI and RPC mode, there is a special RPC option which let's the RPC user define a configuration file that will overwrite all other configuration file or RPC settings. Using <code>"req.opts.config_file = '/path/to/file'"</code> it is possible to provide such a configuration file that overwrites all other settings.
 +
 
 +
'''This can lead to undesired behavior of criu and should only be used carefully.'''
    
=== Related ===
 
=== Related ===
79

edits

Navigation menu