[erlang-questions] Configuration file pointing to other configuration files
Matthieu Vachon
matthieu.ouellette-vachon@REDACTED
Mon Oct 29 16:53:51 CET 2012
Hi Slava,
Thanks for trying and setuping a github repo.
Indeed, I tried with your code and it worked as expected without any
problem. This seemed rather strange since I had tried many different
combinations.
From my findings, it seems that the main configuration must be named
`sys.config` unless what, it will spit out the error message. To
reproduce, rename `sys.config` to `app.config` and restart erlang vm
with `erl -config app`. When doing so, I get my error message:
{"could not start kernel pid",application_controller,"invalid
config data: invalid application name: \"custom\""}
So, having a file named with a different name then `sys.config` will
prevent erlang from reading other referenced configuration files.
Don't know if I should do something more about this like asking for
feature request. Anyhow, thank you for solving this problem
Regards,
Matt
On 2012-10-29 00:15, Slava Yurin wrote:
> Hi Matthieu.
> I used this feature without any problem.
> Here my try https://github.com/nevar/sys_test
> 24.10.2012, 21:03, "Matthieu Vachon"
> <matthieu.ouellette-vachon@REDACTED>:
>>
>> Hi All,
>>
>> In the config documentation page
>> (http://www.erlang.org/doc/man/config.html), it is noted that since
>> R10B, the syntax of sys.config was extended to allow pointing to other
>> configuration files.
>>
>> [{Application, [{Par, Val}]} | File].
>>
>> So, I was wondering if this mechanism is supposed to work when passing a
>> config file via the command line parameter (i.e. -config):
>>
>> erl -boot boot_file -config sys
>>
>> I'm asking the question because in fact, I tried and I tried and I tried
>> without success. My config file looks like this:
>>
>> [
>> {mnesia, [
>> {dir, "db"}
>> ]},
>>
>> "/home/user/project/sys.user.config",
>> ].
>>
>> But anything I put as the File parameter result in an error. I tried
>> without the .config suffix, with a relative path, at the beginning of
>> the line, at the end. It always saying it's an invalid application name.
>> With this kind of error, I fear it works only in conjunction with a full
>> release and its not meant to work with config file passes as command
>> line arguments. Is it right?
>>
>> Here the full error message:
>>
>> could not start kernel pid (application_controller) (invalid config
>> data: invalid application name: "/home/user/project/sys.user.config")
>>
>> Regards,
>> Matt
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED <mailto: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/20121029/5f084a30/attachment.htm>
More information about the erlang-questions
mailing list