diff options
author | Siri Hansen <[email protected]> | 2014-02-18 13:32:49 +0100 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2014-02-18 13:32:49 +0100 |
commit | 3cdd158193146c95c1480d6d11ff4cc277649c24 (patch) | |
tree | fa4860b5673aab7f9777567dab38aadae17da0ac /lib/sasl/src | |
parent | 6c9002f9174d40b69b3a5bcd5ef219ce4ceb3622 (diff) | |
download | otp-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')
-rw-r--r-- | lib/sasl/src/systools_rc.erl | 14 |
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; |