[erlang-questions] OTP question

Edwin Fine erlang-questions_efine@REDACTED
Sun Aug 17 23:34:36 CEST 2008


In test_ser.erl, trap exits:

init([]) ->
*    erlang:process_flag(trap_exit, true),
*    io:format("TEST SERVER INIT.~n",[]),
    {ok, []}.

Hope this helps,
Edwin

2008/8/17 Alpár Jüttner <alpar@REDACTED>

> Hi,
>
> I have a fairly basic problem, probably I did a silly mistake. When I
> stop an application, it does not terminate the supervisor tree. Please
> find an example in the attachment. It is a minimal application with one
> supervisor and a server. When I start the application, the supervisor
> and the server starts nicely:
>
>        $erl
>        Erlang (BEAM) emulator version 5.6.3 [source] [smp:2]
>        [async-threads:0] [hipe] [kernel-poll:false]
>
>        Eshell V5.6.3  (abort with ^G)
>        1> c(test_ser).
>        {ok,test_ser}
>        2> c(test_sup).
>        {ok,test_sup}
>        3> c(test_app).
>        {ok,test_app}
>        4> application:start(test_app).
>        TEST APP START.
>        TEST SUPERVISOR START LINK.
>        TEST SUPERVISOR INIT.
>        TEST SERVER START LINK.
>        TEST SERVER INIT.
>        ok
>
> But when I stop it, test_app:stop/1 is executed, but
> test_sup:terminate/1 and test_server:terminate/2 are not.
>
>        5> application:stop(test_app).
>        TEST APP STOP.
>
>        =INFO REPORT==== 17-Aug-2008::22:27:49 ===
>            application: test_app
>            exited: stopped
>            type: temporary
>        ok
>        6>
>
> What do I do wrong?
>
> Best regards,
> Alpar
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>



-- 
For every expert there is an equal and opposite expert - Arthur C. Clarke
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080817/c0bf3666/attachment.htm>


More information about the erlang-questions mailing list