config: resolving relative paths inconsistent
The configuration contains server.management.rundir
option specifying the working directory for the manager. When we load the configuration for the first time, all paths are resolved relative to the current working directory. After parsing the configuration, the manager changes its working directory, however the parsed relative paths are already resolved. Therefore, after another parsing of the same config, the paths point to different locations.
Potential solutions:
- Our modelling tools resolve all paths to absolute paths at the moment they are parsed. We do this so that we do not have to worry about it when passing the paths to
kresd
or any other place outside of manager. If we removed this path resolving at the time of parsing, we could fix this issue. - We could parse the configuration during initialization twice. First pass would be just use to get the
rundir
. Then we would changecwd
and run the parsing and validation again. This is relatively easy to implement. - Enforce usage of absolute paths. That would help, but it's a unnecessary limitation.
If anyone has any ideas how to solve this, please share. Otherwise I will default to implementing the second option - parsing the configuration twice during startup as I see it as the best option of them all. This would cause:
-
rundir
is relative to initialcwd
- everything else is relative to
rundir