[erlang-questions] erlang restart application

Loïc Hoguin <>
Sat Mar 8 08:21:41 CET 2014


It's not explained in the getting started on purpose, as this is an 
advanced topic.

Basically this is an OTP application, where hello_erlang_app is an 
application behaviour and the hello_erlang_sup is the main supervisor of 
that application.

To answer your question, you can just use:

application:stop(hello_erlang).
application:start(hello_erlang).

With hello_erlang the name of the application.

On the other hand you have a release, which means c(hello_erlang_app) 
doesn't operate on your src/ directory anymore (you don't need to use 
l/1 after using c/1 by the way as it already does it), so the quickest 
way is most likely to just Ctrl+C twice, type make and restart the VM 
again. Another way is to use a reloader that understands releases.

But yeah, I wouldn't worry about these things for quite some time as you 
don't need to know them to operate Cowboy.

On 03/08/2014 08:13 AM, t x wrote:
> Hi,
>
>
> [apologies for this stream of stupid questions; I haven't figured out
> how the various pieces work together yet]
>
>
>    I'm reading http://ninenines.eu/docs/en/cowboy/HEAD/guide/getting_started/
>
>
>    In particular, I'm looking at https://gist.github.com/txrev319/9426556
>
>
>    How does the
>
>      {registered, [hello_erlang_sup]},
>      {mod, {hello_erlang_app, []}},
>
>    lines work?
>
>
>    In particular, how can I restart the hello_erlang_app app ?
>
>    So after I do "_rel/..../ remote_console", I do:
>
>    * c(hello_erlang_app).
>    * l(hello_erlang_app).
>
>    --> now, at this point, how do I _restart_ the existing hello_erlang_app ?
>
>
> Thanks!
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>

-- 
Loïc Hoguin
http://ninenines.eu



More information about the erlang-questions mailing list