Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Automatically start pulse_application_controller

In the ERTS the application_controller (and the kernel) application
is automatically started by the init process. This is not the case
for pulse_application(_controller). I've added a chech to
pulse_application:start(App), which now automatically starts the
pulse_application_controller (and a kernel-app) if necessary.
  • Loading branch information...
commit 1cfc81287b51564ebdcd7ad939f350e2915ea90c 1 parent ef585d9
@hanssv hanssv authored
Showing with 26 additions and 16 deletions.
  1. +6 −0 src/pulse_application.erl
  2. +20 −16 src/pulse_application_controller.erl
View
6 src/pulse_application.erl
@@ -99,6 +99,12 @@ load(Application, DistNodes) ->
%% Workaround due to specs.
load1(Application, DistNodes) ->
+ %% Since pulse_application_controller is not started by the init-process
+ %% (which is the case for application_controller), do an extra check here...
+ case whereis(pulse_application_controller) of
+ undefined -> pulse_application_controller:start();
+ _Pid -> ok
+ end,
case application_controller:load_application(Application) of
ok when DistNodes =/= [] ->
AppName = get_appl_name(Application),
View
36 src/pulse_application_controller.erl
@@ -19,28 +19,28 @@
-module(pulse_application_controller).
%% External exports
--export([start/1,
- load_application/1, unload_application/1,
- start_application/2, start_boot_application/2, stop_application/1,
- control_application/1,
- change_application_data/2, prep_config_change/0, config_change/1,
- which_applications/0, which_applications/1,
- loaded_applications/0, info/0,
- get_pid_env/2, get_env/2, get_pid_all_env/1, get_all_env/1,
- get_pid_key/2, get_key/2, get_pid_all_key/1, get_all_key/1,
- get_master/1, get_application/1, get_application_module/1,
- start_type/1, permit_application/2, do_config_diff/2,
- set_env/3, set_env/4, unset_env/2, unset_env/3]).
+-export([start/0, start/1,
+ load_application/1, unload_application/1,
+ start_application/2, start_boot_application/2, stop_application/1,
+ control_application/1,
+ change_application_data/2, prep_config_change/0, config_change/1,
+ which_applications/0, which_applications/1,
+ loaded_applications/0, info/0,
+ get_pid_env/2, get_env/2, get_pid_all_env/1, get_all_env/1,
+ get_pid_key/2, get_key/2, get_pid_all_key/1, get_all_key/1,
+ get_master/1, get_application/1, get_application_module/1,
+ start_type/1, permit_application/2, do_config_diff/2,
+ set_env/3, set_env/4, unset_env/2, unset_env/3]).
%% Internal exports
--export([handle_call/3, handle_cast/2, handle_info/2, terminate/2,
- code_change/3, init_starter/4, get_loaded/1]).
+-export([handle_call/3, handle_cast/2, handle_info/2, terminate/2,
+ code_change/3, init_starter/4, get_loaded/1]).
%% Test exports, only to be used from the test suites
-export([test_change_apps/2]).
-import(lists, [zf/2, map/2, foreach/2, foldl/3,
- keyfind/3, keydelete/3, keyreplace/4]).
+ keyfind/3, keydelete/3, keyreplace/4]).
-compile({parse_transform, pulse_instrument}).
-compile({pulse_replace_module,
@@ -205,7 +205,11 @@ start(KernelApp) ->
{'EXIT', _Pid, Reason} ->
to_string(Reason)
end.
-
+
+%% pulse_otp - Default start
+start() ->
+ start({application, kernel, []}).
+
%%-----------------------------------------------------------------
%% Func: load_application/1
%% Args: Application = appl_descr() | atom()
Please sign in to comment.
Something went wrong with that request. Please try again.