From: Jonathan Rajotte Date: Fri, 18 May 2018 21:45:57 +0000 (-0400) Subject: Fix: cmd line options overwrite env variable config options X-Git-Tag: v2.10.5~11 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=56c170703d909f138d941d44a2525f000d45ebf1;p=lttng-tools.git Fix: cmd line options overwrite env variable config options The doc is clear about the order of precedence regarding configuration. The command line options always override any config file or configuration by environment variables. Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index cb9e16ec5..88877c700 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -5552,6 +5552,12 @@ int main(int argc, char **argv) goto exit_set_signal_handler; } + /* + * Init config from environment variables. + * Command line option override env configuration per-doc. Do env first. + */ + sessiond_config_apply_env_config(&config); + /* * Parse arguments and load the daemon configuration file. * @@ -5566,9 +5572,6 @@ int main(int argc, char **argv) goto exit_options; } - /* Init config from environment variables. */ - sessiond_config_apply_env_config(&config); - /* * Resolve all paths received as arguments, configuration option, or * through environment variable as absolute paths. This is necessary