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

Tristan Sloughter t@REDACTED
Sat Feb 17 20:20:32 CET 2018


Right, you don't need it to load an application in a release. But that
wasn't your question. I was just replying that it isn't a convention
since specific features, as you note, rely on it.
--
  Tristan Sloughter
  "I am not a crackpot" - Abe Simpson
  t@REDACTED


On Sat, Feb 17, 2018, at 11:09 AM, Xavier Noria wrote:
> On Sat, Feb 17, 2018 at 7:49 PM, Tristan Sloughter
> <t@REDACTED> wrote:> 
>> __
>> 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 has already been stated in previous messages, and it is
> implemented here[1].> 
> If you look at the code, it says that *if* the basename is
> "sys.config", you *can* nest. That is not the same as saying that you
> need sys.config to load an application in a release. We have seen some
> counterexamples, you can edit the generated shell scripts to load
> ~/foo.config and it boots just fine, some tools have support for
> alternative files, and, definitive, if you read
> application_controller.erl you'll see the file is not assumed to be
> anywhere.> 
> The release handler is the only piece of code to my knowledge that
> critically depends on its existence. If I read its code correctly, if
> you want the environment variables merged in an upgrade, sys.config
> *must* be located under Vsn. *That* is a requirement, but if you don't
> do release upgrades, anything can be passed to -config (which is what
> generated scripts do).> 
> 


Links:

  1. https://github.com/erlang/otp/blob/7304c1e1deed6ac1fbddc88ea5c6d5138231dbf7/lib/kernel/src/application_controller.erl#L1821
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20180217/d6c7e76d/attachment.htm>


More information about the erlang-questions mailing list