erl startup

Wes James comptekki@REDACTED
Wed May 19 03:11:51 CEST 2010


On Tue, May 18, 2010 at 2:13 PM, Wes James <comptekki@REDACTED> wrote:
> I am trying to get yaws to start a module with:
>
> yaws -r my_module --mnesiadir /path/to/mnesiadata
>
> yaws is a shell script that builds this in to:
>
> erl +K true -pa /usr/local/lib/yaws/ebin      -run yaws     -run
> my_mod   -mnesia dir '"/Users/zulu/0erl/prt"' -run mnesia start
>
> mnesia starts up fine, but my mod does not. After getting yaws started
> up I can then do my_mod:start() and it starts fine.  According to the
> command line options -run should run my_mod:start()  but it doesn't
> seem to do this, even if I copy and paste the line above (should be
> same anyway).
>
> Why doesn't -run my_mod fire a my_mod:start()?

Well after starting a new shell and starting things fresh I am finally
getting the my_mod:start() to work:

start() ->
	Id_Table=ets:new(start_id_table, []),
	io:format("~w~n",  [Id_Table]),
	{ok, TRef}=timer:apply_interval(1000*60*5, prt, getc, []), % 1000
milliseconds * 60 * 5 = 5 minutes
	ets:insert(Id_Table, {id, TRef}),
	Id_Table.

I see the output from the io:format above but the timer does not seem
to be running after erlang starts up.

I'll keep poking to see what's going on.

-wes


More information about the erlang-questions mailing list