<div dir="ltr">Hi all,<div><br></div><div>I am fairly new to Erlang, so reading a lot of docs and trying out lots of new things. The problem I am now facing and cannot get an elegant solution for is the following:</div><div><br></div><div>When I upgrade a release, containing an application which has set application parameters using 'application:set_env/3', they are disgarded after having called 'release_handler:install_release/1'.</div><div><br></div><div>This is described in the manual here: <a href="http://erlang.org/doc/design_principles/release_handling.html#id84983">http://erlang.org/doc/design_principles/release_handling.html#id84983</a> quoting:</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">This means that parameter values set in the other system configuration files and values set using application:set_env/3 are disregarded.<br>When an installed release is made permanent, the system process init is set to point out the new sys.config.</blockquote><div><br></div><div>The application using application:set_env/3 in this case is riak_core, which I have as a dependency. I circumnavigate this by including the old sys.config in the release (which has been generated by cuttlefish before) and then calling a function inside riak_core that re-appends the remaining application parameters they made earlier with 'application:set_env/3' calls. I include this function call in my relup file.</div><div><br></div><div>However, this does not seem like an elegant solution to my problem. Is there another way to *not* discard the application parameters at all during an upgrade of a new release? How to use the same parameters currently in the running release?</div><div><br></div><div>If I don't include a sys.config in the release folder ($ROOT/Releases/VSN), all system config and application parameters are cleared. I have checked this myself, unless I am doing something very wrong.</div><div><br></div><div>I could also extract all current application's parameters using application:get_all_env/1 for every app running, before releasing, and put those in the new sys.config file.</div><div><br></div><div>Could not find this problem or a solution in the mailing list before or on any other site. Maybe I am doing something wrong with my releases and upgrading them in general... Any other ideas or people facing this problem? </div><div><br></div><div>Thanks,</div><div><br></div><div>Johan</div></div>