Unable to override vm.args in rebar generated release
I'm trying to override the configuration of a release made using Rebar. I'd like to automatically modify the vm.args file to use an -sname chat
parameter to the VM, rather than the default -name chat@127.0.0.1
.
If I understand it correctly, the subdirectory files
contains versions of the configuration files that will be copied into a release directory when I use rebar create-node nodeid=chat
. I am not forcing an overwrite, and I've modified the version in files with the values I want to use. It doesn't make it through to the release. Whenever I recreate the release, it overwrites the file ./etc/vm.args
with default values. Am I using rebar incorrectly?
Here's what I've been doing (in a Makefile) to generate the release:
gen-rel:
rm -rf ./rel/*
rebar create-node nodeid=chat
rebar generate
start:
./rel/chat/bin/chat start
stop:
./rel/chat/bin/chat stop
ping:
./rel/chat/bin/chat ping
rebuild: stop compile gen-rel start ping
PS: Is this how I'm supposed to be building and debugging using rebar? I have another node that I want to connect to this with, and I assumed that creating and running the release is the quickest and easiest way to get my re开发者_运维百科lease reachable...
The create-node
rebar subcommand should only be run once, rather than every time before generate
. If you remove create-node
line from your gen-rel
make target and edit the rel/files/vm.args
files with your overrides then you should find the generated release will now contain your overrides.
Recap steps:
- Remove
rebar create-node nodeid=chat
line from your make file (just run it once). - Update the
rel/files/vm.args
file with your override(s). - Run
make rebuild
. - Commit your rel/files override changes into your SCM/VCS repository before you lose them;)
HTH
精彩评论