From ca8b20a9c7e7edd8ba27df809cb1eee060bf459b Mon Sep 17 00:00:00 2001 From: Luis Rascao Date: Tue, 16 Aug 2016 14:52:08 +0100 Subject: 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}} --- priv/templates/install_upgrade_escript | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'priv/templates/install_upgrade_escript') 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) -> -- cgit v1.2.3