<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style>
</head>
<body><div>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:<br></div>
<div><br></div>
<div>[{my_app, [...]},<br></div>
<div> "other.config"}].<br></div>
<div><br></div>
<div>This will inclue the content of other.config, but only if the file this is in is sys.config.<br></div>
<div><br></div>
<div>Note that I have a PR to also make sys.config.src an option, <a href="https://github.com/erlang/otp/pull/1560">https://github.com/erlang/otp/pull/1560</a>. 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}}. </div>
<div><br></div>
<div id="sig19496053"><div class="signature">--<br></div>
<div class="signature">  Tristan Sloughter<br></div>
<div class="signature">  "I am not a crackpot" - Abe Simpson<br></div>
<div class="signature">  t@crashfast.com<br></div>
</div>
<div><br></div>
<div><br></div>
<div>On Tue, Feb 13, 2018, at 12:11 PM, Xavier Noria wrote:<br></div>
<blockquote type="cite"><div dir="ltr"><div>Some explanations of what's a release kind of assume there is a <span style="">sys</span>.<span style="">config</span> file to override application environment variables.<br></div>
<div><br></div>
<div>I don't quite find source code in <span style="">Erlang</span>/<span style="">OTP</span> that specifically looks for that file. What I see, instead, is that the scripts generated by build tools pass -<span style="">config</span> <span style="">sys</span>.<span style="">config</span> to <span style="">erl</span>(1) if the file exists. Then, the application controller merges whatever goes in -<span style="">config</span> (though some comments in the source code do mention <span style="">sys</span>.<span style="">config</span>).<br></div>
<div><br></div>
<div>So, is <span style="">sys</span>.<span style="">config</span> a special-cased file in releases like other expected directories or files? Or is it actually just a convention?<br></div>
<div><br></div>
<div>I noticed "Designing for Scalability with <span style="">Erlang</span>/<span style="">OTP</span>" does not mention <span style="">sys</span>.<span style="">config</span> when explaining releases. It only appears later on together with <span style="">vm</span>.<span style="">args</span> when talking about rebar3.<br></div>
</div>
<div><u>_______________________________________________</u><br></div>
<div>erlang-questions mailing list<br></div>
<div><a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br></div>
<div><a href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a><br></div>
</blockquote><div><br></div>
</body>
</html>