aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sasl/src/systools_rc.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2014-02-18 13:32:49 +0100
committerSiri Hansen <[email protected]>2014-02-18 13:32:49 +0100
commit3cdd158193146c95c1480d6d11ff4cc277649c24 (patch)
treefa4860b5673aab7f9777567dab38aadae17da0ac /lib/sasl/src/systools_rc.erl
parent6c9002f9174d40b69b3a5bcd5ef219ce4ceb3622 (diff)
downloadotp-3cdd158193146c95c1480d6d11ff4cc277649c24.tar.gz
otp-3cdd158193146c95c1480d6d11ff4cc277649c24.tar.bz2
otp-3cdd158193146c95c1480d6d11ff4cc277649c24.zip
[sasl] Use restart type from .rel when restarting apps during upgrade
Earlier the 'restart_application' upgrade instruction always cause the application to be restarted as permanent. This could cause the system to end up in an unexpected state after an upgrade. This is now corrected.
Diffstat (limited to 'lib/sasl/src/systools_rc.erl')
-rw-r--r--lib/sasl/src/systools_rc.erl14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/sasl/src/systools_rc.erl b/lib/sasl/src/systools_rc.erl
index 54c327410d..76f753c3d0 100644
--- a/lib/sasl/src/systools_rc.erl
+++ b/lib/sasl/src/systools_rc.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -365,14 +365,22 @@ translate_application_instrs(Script, Appls, PreAppls) ->
case lists:keysearch(Appl, #application.name, Appls) of
{value, PostApplication} ->
PostMods = PostApplication#application.modules,
+ Type = PostApplication#application.type,
+ Apply =
+ case Type of
+ none -> [];
+ load -> [{apply, {application, load,
+ [Appl]}}];
+ _ -> [{apply, {application, start,
+ [Appl, Type]}}]
+ end,
[{apply, {application, stop, [Appl]}}] ++
[{remove, {M, brutal_purge, brutal_purge}}
|| M <- PreMods] ++
[{purge, PreMods}] ++
[{add_module, M, []} || M <- PostMods] ++
- [{apply, {application, start,
- [Appl, permanent]}}];
+ Apply;
false ->
throw({error, {no_such_application, Appl}})
end;