[CRIU] [PATCH v3 5/7] config: check for CRIU_CONFIG_FILE environment variable
Pavel Emelyanov
xemul at virtuozzo.com
Mon Jul 9 20:16:12 MSK 2018
>>> Do you see it as an important difference if the configuration file is in
>>> a custom location? Like if the user already specified a custom
>>> configuration file location then it is something special and must
>>> override the RPC client?
>>
>> Location of the config file can be any. I see it useful to tell criu where to read
>> (one of) config from because reading a config file from "known place" will break
>> concurrent runs of criu-s with different "options".
>
> What am I missing here is how to tell CRIU which of possible
> configuration files to use.
Yes...
>>> We can also easily provide a setting 'prefer config file' via CLI, to
>>> match the RPC behavior.
>>>
>>>> Does Andrey want smth different?
>>>
>>> Not sure ;) I will let him answer that.
>>>
>>>
>>> It feels like we are getting close to a solution and we only need to
>>> come to a consensus about the right behavior. If we continue the
>>> discussion we should soon have something acceptable to everyone.
>>>
>>> Do we want configuration files with different meaning?
>>
>> I vote for "all config files being the same" but the order of reading matters.
>
> That already exists:
>
> First /etc/criu/default.conf then $HOME/.criu/default.conf then CLI/RPC:
>
> /etc/criu/default.conf -> $HOME/.criu/default.conf -> CLI/RPC
>
> Custom configuration file replaces /etc/criu/default.conf and $HOME/.criu/default.conf so:
>
> CRIU_CONFIG_FILE -> CLI/RPC
>
> So you are proposing to change it to
>
> /etc/criu/default.conf -> $HOME/.criu/default.conf -> CRIU_CONFIG_FILE -> CLI/RPC
>
> and if 'prefer config file' is set via CLI/RPC it would change to:
>
> CLI/RPC -> /etc/criu/default.conf -> $HOME/.criu/default.conf -> CRIU_CONFIG_FILE
>
> Right?
Almost. If 'prefer config file' is set then
global config -> home config -> CLI/RPC -> given config
(and if it's not, then global -> home -> given -> CLI/RPC)
> And only if '--no-default-config' is set then we would get:
>
> CRIU_CONFIG_FILE -> CLI/RPC
Then
home config -> given config -> CLI/RPC?
IOW -- why skipping the home config?
> or if 'prefer config file' is set via CLI/RPC it would change to:
>
> CLI/RPC -> CRIU_CONFIG_FILE
>
> Can we also set '--no-default-config' and 'prefer config file' via the
> configuration file. (I would say no)
>
> So if 'no-default-config' is part of CRIU_CONFIG_FILE the other two
> configurations files are ignored after they have already been parsed.
>
> Can 'prefer config file' be also set in the configuration files? In all
> of them? Or only in CRIU_CONFIG_FILE?
I would state that 'prefer config file' is ignored when read from any config.
To keep things as simple as it's possible with this weird scheme %)
> The behavior would be the same for RPC and CLI CRIU usage.
>
> The most important changes from my current patches to this would be that
> CRIU_CONFIG_FILE does not disable /etc/criu/default.conf and
> $HOME/.criu/default.conf parsing and that CLI needs
> '--prefer-config-file'.
>
> Adrian
>
> Adrian
> .
>
More information about the CRIU
mailing list