[erlang-questions] escript and epmd

Stefan Strigler steve@REDACTED
Wed Sep 19 18:42:48 CEST 2007

Hi, next question :)

How can I make sure that epmd is running when using escript. I want to
start a named node from within escript and ping some other node like

#!/usr/bin/env escript

main(_) ->
  net_kernel:start([foo, shortnames]),
  case net_adm:ping(some_other_node) of
    pong -> ...
    pang -> %% spawn some_other_node

But if epmd isn't running already I get:

=INFO REPORT==== 19-Sep-2007::18:50:36 ===
Protocol: "inet_tcp": register error: {{badmatch,{error,econnrefused}},
escript: script failed with error reason function_clause

Any help appreciated, Steve

More information about the erlang-questions mailing list