[erlang-questions] sys.config and OTP-4867
Jesper Louis Andersen
Thu Aug 20 15:33:27 CEST 2015
In the config(5) man page we have a sys.config section:
Which allows us to merge a file into the existing sys.config:
This is a very neat trick, but if we read the code in
`application_controller` there is a reference to OTP-4867 and this is only
enabled for files named `sys.config`. This has bitten me several times,
when people end up naming
their configuration file differently. What is the reasoning behind limiting
this to sys.config? And would it be possible to relax the naming constraint
such that there is a set of files which gets file expansion?
The reason I'm asking is because the whole game of configuring an
application is a complex afair. Some environments are able to write files,
whereas others are relying on the OS environment variables for certain
settings. And yet others would like to be able to point to a file-chain
which gets progressively merged into the configuration, like in sys.config.
In some environments, sys.config is run through a preprocessor and its
contents are replaced by writing a temporary file next to sys.config. But
once loaded, this newly temp file is not amenable to OTP-4867 substitution
:/ And writing in the other direction, from a stanza file into sys.config
also seems somewhat futile.
Clearly there were a lot of thought put into this configuration inside
Ericsson, so in particular, how is a large Erlang system configured in a
painless way? Specifically, how does one go about procuring a release of
the software which doesn't change its checksum but can run in several
environments: staging, user-acceptance-testing, production and contains
*no* secret keys as part of its build but reads these from outside (e.g.,
the environmental "context" in which it has been deployed?)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions