erlware / relx

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

Patch to fix #523 #526

Closed GoelDeepak closed 7 years ago

GoelDeepak commented 7 years ago

Issue 1: If RELX_REPLACE_OS_VARS is true then existing vm.args (sys.config) file is renamed to vm.arg.orig (sys.config.orig) and a new vm.args (sys.config) is generated. However, if for some reason new vm.args (sys.config) is not generated then system ends up without a valid vm.args (sys.config) file and keeps failing thereafter.

Issue 2: Continuing from issue 1, if the system does not have sufficient disk space or the current directory is immutable then new vm.args (sys.config) will not be generated.

This patch tries to fix both the above issues by keeping the existing vm.args (sys.config) untouched and creates a new vm.args (sys.config) in /tmp directory

lrascao commented 7 years ago

Now that the other PR has been merged, could you please rebase onto master and make the necessary changes? Since you're working on this would you mind taking a look at #427 and maybe considering porting that fix as well? With this PR the .orig will live on /tmp so i think it's important to support multi-node setups running on the same machine

GoelDeepak commented 7 years ago

@lrascao I rebased my PR and verified against your new test cases. Could you review the changes? These changes would also work for multi-node as I create a random file for each run. Should I care about cleaning up the /tmp dir?

lrascao commented 7 years ago

looks good, could you please just port the comments that got dropped in check_replace_os_vars? Makes for better understanding

GoelDeepak commented 7 years ago

Done.