aboutsummaryrefslogtreecommitdiffstats
path: root/priv
diff options
context:
space:
mode:
authorLuis Rascao <[email protected]>2016-08-16 14:52:08 +0100
committerLuis Rascao <[email protected]>2016-08-16 16:53:12 +0100
commitca8b20a9c7e7edd8ba27df809cb1eee060bf459b (patch)
tree366c92e5048b00b543598554b7cdf303bda5bd0c /priv
parent9168eab9d949cb5fb3fe09b9e73cf404295e97ff (diff)
downloadrelx-ca8b20a9c7e7edd8ba27df809cb1eee060bf459b.tar.gz
relx-ca8b20a9c7e7edd8ba27df809cb1eee060bf459b.tar.bz2
relx-ca8b20a9c7e7edd8ba27df809cb1eee060bf459b.zip
Handle release_handler old_processes error when doing a soft purge relup
As described in http://erlang.org/doc/man/appup.html, when performing a relup with soft purge: If the value is soft_purge, release_handler:install_release/1 returns {error,{old_processes,Mod}}
Diffstat (limited to 'priv')
-rw-r--r--priv/templates/install_upgrade_escript13
1 files changed, 12 insertions, 1 deletions
diff --git a/priv/templates/install_upgrade_escript b/priv/templates/install_upgrade_escript
index 4abce85..0910c38 100644
--- a/priv/templates/install_upgrade_escript
+++ b/priv/templates/install_upgrade_escript
@@ -92,7 +92,18 @@ install_and_permafy(TargetNode, RelName, Vsn) ->
[io_lib:format("* ~s\t~s~n",[V,S]) || {V,S} <- which_releases(TargetNode)]),
?INFO("Installed versions:~n~s", [VerList]),
?INFO("ERROR: Unable to revert to '~s' - not installed.~n", [Vsn]),
- erlang:halt(2)
+ erlang:halt(2);
+ %% as described in http://erlang.org/doc/man/appup.html, when performing a relup
+ %% with soft purge:
+ %% If the value is soft_purge, release_handler:install_release/1
+ %% returns {error,{old_processes,Mod}}
+ {error, {old_processes, Mod}} ->
+ ?INFO("ERROR: unable to install '~s' - old processes still running code from module ~p~n",
+ [Vsn, Mod]),
+ erlang:halt(3);
+ {error, Reason1} ->
+ ?INFO("ERROR: release_handler:install_release failed: ~p~n",[Reason1]),
+ erlang:halt(4)
end.
permafy(TargetNode, RelName, Vsn) ->