[erlang-questions] Making rpc calls from escript

Attila Babo <>
Wed Sep 3 15:17:30 CEST 2008

On machine A
  epmd -daemon
  erl -name bill -setcookie TheSameCookie

On machine B
  epmd -daemon

  #!/usr/bin/env escript
  main(_) ->
    ok = application:start(inets),
    {ok, _} = net_kernel:start([john]),
    true = auth:set_cookie('TheSameCookie'),
	io:format("Result: ~p~n",
		rpc:call('', erlang, time, [])

Please note, on machine B you must use a fully qualified domain name
instead of the IP address and that must match with the resolved name
on machine A. In a none production machine it's easier to use short

More information about the erlang-questions mailing list