Dynamicly generated websites in Erlang

Ulf Wiger etxuwig@REDACTED
Tue Mar 27 10:37:03 CEST 2001


On 27 Mar 2001, J Scott Jaderholm wrote:

>
>Hi Torbjorn,
>
>Torbjorn Tornkvist <tobbe@REDACTED> writes:
>
>> Start Erlang with the switches: -config /...../xxx/inets -s my
>
>I do and get this error

>{'init terminating in
>do_boot',{undef,[{my,start,[]},{init,start_it,1},{init,start_em,1}]}}
>init terminating in do_boot ()

You need to write a function my:start(). The '-s my' flag is basically
short for '-s my start', that is, "start a process by calling
my:start()". More on that below.


>Btw, is it normal to get like 4-5 PROGRESS REPORTs when startin
>inets?

Yes. When you start your Erlang node with SASL activated (e.g. 'erl
-boot start_sasl'), you will get a progress report for every process
started using proc_lib.erl. This includes all processes based on OTP
behaviours (gen_server, gen_fsm, supervisor, ...)

If they really bug you, you can turn them off with the flag 
'-sasl errlog_type error'. This will only give you the error and crash
reports.


>> In your startup code in my.erl, call:  application:start(inets)
>
>I'm not sure waht you mean by startup code.

my:start() needs to start a process (see 'erl -man init'


    "The functions are executed sequentially  in  the  ini-
    tialization  process,  which  then terminates normally
    and passes control to the user. This means that  a  -s
    call  which does not terminate will block further pro-
    cessing; to avoid this, use some variant of  spawn  in
    such cases."

Of course, this man page also recommends that the -run flag be used
instead of the -s flag. In this case, it doesn't matter.

I noticed that Tobbe gave you an example of run.erl, so I'll stop
here.

/Uffe
-- 
Ulf Wiger                                    tfn: +46  8 719 81 95
Senior System Architect                      mob: +46 70 519 81 95
Strategic Product & System Management    ATM Multiservice Networks
Data Backbone & Optical Services Division      Ericsson Telecom AB





More information about the erlang-questions mailing list