Error in Supervisor model

Surindar Sivanesan surindar.shanthi@REDACTED
Mon Jan 9 13:18:21 CET 2006


Im new to OTP.When i start the supervisor, while it is creating child,
it encounter error and the supervisor exit.Please give me the reason
why this happens,Also give me the solutuon to this problem

The supervisor code is

-module(super).
-compile(export_all).
-behaviour(supervisor).

start()->
	supervisor:start_link({local,head},?MODULE,[]),
		
init(Any)->
         {ok,{
              {one_for_one,1,60},
               [test,{test,start,[]},permanent,brutal_kill,worker ,[test]}
               ]
               }
          }.


The child code is


-module(test).
-compile(export_all).
-behaviour(gen_fsm).

start()->
	gen_fsm:start_link({local,name},test,[],[]).
	
init(A)->
	{ok,free,[]}.

But if i do the same coding with one loop in the child, the supervisor
is not exiting.
The child code is

module(test).
-compile(export_all).
-behaviour(gen_fsm).

start()->
	gen_fsm:start_link({local,name},test,[],[]),
                 loop().
	
init(A)->
	{ok,free,[]}.

loop()->
   loop().

Please clarify this
--
with regards,
S.Surindar



More information about the erlang-questions mailing list