[CRIU] [PATCH v3 5/7] config: check for CRIU_CONFIG_FILE environment variable

Adrian Reber adrian at lisas.de
Tue Jul 10 12:38:05 MSK 2018


On Mon, Jul 09, 2018 at 08:16:12PM +0300, Pavel Emelyanov wrote:
> >>> 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 %)

Okay, thanks. I will do these changes on top of the current patchset.

		Adrian


More information about the CRIU mailing list