erlware / relx

Sane, simple release creation for Erlang
http://erlware.github.io/relx
Apache License 2.0
697 stars 232 forks source link

impossible to use config files which point to other config files #562

Closed brigadier closed 7 years ago

brigadier commented 7 years ago

Erlang allows (http://erlang.org/doc/man/config.html) including config files into application config files with syntax like that:

[{myapp,[{par1,val1},{par2,val2}]},
 "/home/user/myconfig"].

But it looks like this works only when config file is named exactly sys.config. As the newer versions of relx when RELX_REPLACE_OS_VARS=true rename sys.config to sys.[nodename].config it is no more possible to include other files.

Related discussion: http://erlang.org/pipermail/erlang-questions/2012-October/070278.html

tsloughter commented 7 years ago

Right, I don't think we'll be able to support both features at the same time unless there were changes to OTP.

brigadier commented 7 years ago

What's could be wrong with the app.src way? Let people create vm.args.src with placeholders and rename it to vm.args before each run. It worked almost like this a few versions ago, but it used to rename vm.args to vm.args.orig, so it eventually owerwrited the file with palceholders. Am I missing something?

tsloughter commented 7 years ago

Ah crap. This was a result of this patch https://github.com/erlware/relx/pull/427

I'm not sure what to do here... Going to have to think more on this.

bitwalker commented 7 years ago

Seems to me the best option is to make the change from that patch a configuration option, as multi node setups running from the same physical location has to be a pretty rare configuration. You'd still have the same problem when it's enabled, but it would affect a much smaller group of users, who are probably more willing to make tradeoffs in that situation. That said, it does introduce more complexity and configurations to test, so it's not without downsides.

brigadier commented 7 years ago

I'm more concerned not about multinode, but about letting people configure cookie. And before this patch it also worked incorrectly, though differently incorrectly - see https://github.com/erlware/relx/issues/561

lrascao commented 7 years ago

Extended start/stop script hooks (#445) could be a good replacement instead of RELX_REPLACE_OS_VARS, that way people can do whatever they want with their sys.config or vm.args. That said i'm inclined to agree with @bitwalker, i also don't really have a good solution for this besides allowing the disable by configuration of the multi-node feature introduced in #427.

lrascao commented 7 years ago

@brigadier, could you please try out #563 and check if it fixes this issue?

brigadier commented 7 years ago

Yes it does. I've just built rebar with this branch and it fixed both issues. It is quite implicit though.

lrascao commented 7 years ago

closing via #563