[erlang-questions] is sys.config mostly a convention?

Tristan Sloughter t@REDACTED
Sat Feb 17 19:49:19 CET 2018


It is not a convention. Only with a file named sys.config will the
runtime read in additional configs you may include within it by name.
With sys.config you can do:
[{my_app, [...]},
 "other.config"}].

This will inclue the content of other.config, but only if the file this
is in is sys.config.
Note that I have a PR to also make sys.config.src an option,
https://github.com/erlang/otp/pull/1560. This improves the ability to
template a config, like is done with RELX_REPLACE_OS_VARS. Currently
your template has to be a valid Erlang term, so `{port, ${PORT}}`
doesn't work, only `{port, "${PORT}}.
--
  Tristan Sloughter
  "I am not a crackpot" - Abe Simpson
  t@REDACTED


On Tue, Feb 13, 2018, at 12:11 PM, Xavier Noria wrote:
> Some explanations of what's a release kind of assume there is a
> sys.config file to override application environment variables.> 
> I don't quite find source code in Erlang/OTP that specifically looks
> for that file. What I see, instead, is that the scripts generated by
> build tools pass -config sys.config to erl(1) if the file exists.
> Then, the application controller merges whatever goes in -config
> (though some comments in the source code do mention sys.config).> 
> So, is sys.config a special-cased file in releases like other expected
> directories or files? Or is it actually just a convention?> 
> I noticed "Designing for Scalability with Erlang/OTP" does not mention
> sys.config when explaining releases. It only appears later on together
> with vm.args when talking about rebar3.> _________________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20180217/1cc2b517/attachment.htm>


More information about the erlang-questions mailing list