diff --git a/apps/emqx_machine/src/emqx_machine.erl b/apps/emqx_machine/src/emqx_machine.erl index 229e8ca7e..fcf8d3239 100644 --- a/apps/emqx_machine/src/emqx_machine.erl +++ b/apps/emqx_machine/src/emqx_machine.erl @@ -51,9 +51,7 @@ start() -> ok = print_vsn(), - ok = start_autocluster(), - %% NOTE: keep this to the end - ok = emqx_machine_terminator:start(). + ok = start_autocluster(). graceful_shutdown() -> emqx_machine_terminator:graceful_wait(). diff --git a/apps/emqx_machine/src/emqx_machine_app.erl b/apps/emqx_machine/src/emqx_machine_app.erl index 9a9b13d8f..609df37d1 100644 --- a/apps/emqx_machine/src/emqx_machine_app.erl +++ b/apps/emqx_machine/src/emqx_machine_app.erl @@ -24,7 +24,9 @@ start(_Type, _Args) -> ok = emqx_machine:start(), - emqx_machine_sup:start_link(). + {ok, Sup} = emqx_machine_sup:start_link(), + ok = emqx_machine_terminator:start(), + {ok, Sup}. stop(_State) -> ok.