Erlang relx: add appmon but told application already started

107 views Asked by At

I try add appmon in ranch example, here is my relx.config file

{paths, ["/usr/local/lib"]}.
{release, {tcp_echo_example, "1"}, [
   tcp_echo,
   appmon
]}.
{extended_start_script, true}.

After generated, I start application succeed but failed start appmon in Erlang console

([email protected])3> application:start(appmon). 
{error,{already_started,appmon}}

Looks appmon already started, but how can I see the appmon window?

Erlang: R16B02
relx: 1.0.2

1

There are 1 answers

1
P_A On

Appmon is already started and there is no need to start it again.

Also you can use:

%% OTP >= R16B01
ok = application:ensure_started(App)

or something like

case application:start(App) of
    ok -> ok;
    {error, {already_started, App}} -> ok
end

to ensure run the application.