Hi!<div><br></div><div>The functions specified with -s are not evaluated by the shell process. See this response to a similar question for a better explanation of what actually happens when you start misultins supervisor this way.</div>
<div><br></div><div><a href="http://erlang.org/pipermail/erlang-questions/2009-February/041805.html">http://erlang.org/pipermail/erlang-questions/2009-February/041805.html</a></div><div><br>MVH Magnus</div><div><br><div class="gmail_quote">
On Thu, Nov 3, 2011 at 8:13 PM, Wes James <span dir="ltr"><<a href="mailto:comptekki@gmail.com">comptekki@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
When I do this:<br>
<br>
erl -name node@host -pa /usr/local/src/misultin/ebin -run my_mod start<br>
8080 -run my_second_mod<br>
<br>
my_second_mod starts fine but the misultin part won't auto-start.<br>
After erl has started I have to run it manually:  my_mod:start(8080).<br>
<br>
This is the top of the test misultin code:<br>
<br>
<br>
-module(my_mod).<br>
-export([start/1, stop/0]).<br>
<br>
% start misultin http server<br>
start(Port) when is_integer(Port) -><br>
    io:format("~n is integer ~n"),<br>
    start1(Port);<br>
start([Port]) -><br>
    io:format("~n is list: ~p ~n",[Port]),<br>
    PortInt=list_to_integer(Port),<br>
    start1(PortInt).<br>
<br>
start1(Port) -><br>
io:format("~n in start1 ~n"),<br>
    misultin:start_link([{port, Port}, {loop, fun(Req) -><br>
handle_http(Req, Port) end}, {ws_loop, fun(Ws) -> handle_websocket(Ws)<br>
end}]).<br>
<br>
<br>
....<br>
<br>
I can tell that it is reaching start1() from either the -run or from<br>
inside erl, but the misultin:start_link doesn't seem to work from<br>
-run.  Any ideas why?<br>
<br>
The reason I have two start() funs, is if started via erl -run the<br>
8080 comes in as ["8080"], whereas in erl VM , it is just an integer<br>
with my_mod:start(8080).<br>
<br>
Thanks,<br>
<br>
-wes<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div><br></div>