From 7b44caeae4d108c4707ec69af0a4515ebcfd843f Mon Sep 17 00:00:00 2001 From: ieQu1 <99872536+ieQu1@users.noreply.github.com> Date: Wed, 16 Aug 2023 15:48:18 +0200 Subject: [PATCH] fix(emqx_machine_boot): Fix excluded_apps --- apps/emqx_machine/src/emqx_machine_boot.erl | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/apps/emqx_machine/src/emqx_machine_boot.erl b/apps/emqx_machine/src/emqx_machine_boot.erl index 82b909b4f..481927765 100644 --- a/apps/emqx_machine/src/emqx_machine_boot.erl +++ b/apps/emqx_machine/src/emqx_machine_boot.erl @@ -30,12 +30,19 @@ -export([sorted_reboot_apps/1, reboot_apps/0]). -endif. -%% these apps are always (re)started by emqx_machine +%% These apps are always (re)started by emqx_machine: -define(BASIC_REBOOT_APPS, [gproc, esockd, ranch, cowboy, emqx]). -%% If any of these applications crash, the entire EMQX node shuts down +%% If any of these applications crash, the entire EMQX node shuts down: -define(BASIC_PERMANENT_APPS, [mria, ekka, esockd, emqx]). +%% These apps should NOT be (re)started automatically: +-define(EXCLUDED_APPS, [system_monitor, observer_cli, jq]). + +%% These apps are optional, they may or may not be present in the +%% release, depending on the build flags: +-define(OPTIONAL_APPS, [bcrypt, observer]). + post_boot() -> ok = ensure_apps_started(), ok = print_vsn(), @@ -148,9 +155,9 @@ basic_reboot_apps() -> ?BASIC_REBOOT_APPS ++ (BusinessApps -- excluded_apps()). excluded_apps() -> - OptionalApps = [bcrypt, jq, observer], - [system_monitor, observer_cli] ++ - [App || App <- OptionalApps, not is_app(App)]. + %% Optional apps _should_ be (re)started automatically, but only + %% when they are found in the release: + ?EXCLUDED_APPS ++ [App || App <- ?OPTIONAL_APPS, not is_app(App)]. is_app(Name) -> case application:load(Name) of