[erlang-questions] Making rpc calls from escript

Dave Smith dizzyd@REDACTED
Mon Sep 1 06:53:19 CEST 2008


I believe you probably need to start net_kernel in order to make that
rpc call. Without net_kernel running, there is no distributed Erlang.

You should be able to do something like:

net_kernel:start([foobar, longnames]).

(Assuming your hostname is properly configured).

Hope that helps,

D.

On Sun, Aug 31, 2008 at 10:32 PM, Vik Olliver <vik@REDACTED> wrote:
> Having great fun here. There is an Erlang function I wish to call on the
> local machine. If I remsh into the current process and look at the
> prompt, I see it is called: erms@REDACTED
>
> That's the IP address of the local machine, so I know I've got the right
> one - and my magic cookie seems to be correct or I wouldn't get this
> far.
>
> So, I put in my escript:
>
> #!/usr/bin/env escript
> main([Blah]) ->
> io:format("RPC does ~p~n",[
>  rpc:call('erms@REDACTED', erms_reports,
>    repopulate, [Blah] )]) .
>
> (Some parameters and names omitted to protect the guilty, but trust me:
> erms_reports:repopulate is there alright)
>
> Basically, I see:
> RPC does {badrpc,nodedown}
>
> Now the node is not down, 'cos I can remsh into the bally thing with:
> erl -name con2@REDACTED -remsh erms@REDACTED
>
> So why, in its infinite wisdom, does escript not connect? Does it
> require white mice, mystic runes and a moonlit night, or what?
>
> Vik :v)
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>



More information about the erlang-questions mailing list