Skip to content

Commit

Permalink
Fix bug 294
Browse files Browse the repository at this point in the history
  • Loading branch information
Tuncer Ayaz committed Jan 29, 2011
1 parent 926baa1 commit b894682
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions priv/templates/simplenode.nodetool
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
%% -------------------------------------------------------------------

main(Args) ->
ok = start_epmd(),
%% Extract the args
{RestArgs, TargetNode} = process_args(Args, [], undefined),

Expand Down Expand Up @@ -73,6 +74,27 @@ process_args([Arg | Rest], Acc, Opts) ->
process_args(Rest, [Arg | Acc], Opts).


start_epmd() ->
[] = os:cmd(epmd_path() ++ " -daemon"),
ok.

epmd_path() ->
ErtsBinDir = filename:dirname(escript:script_name()),
Name = "epmd",
case os:find_executable(Name, ErtsBinDir) of
false ->
case os:find_executable(Name) of
false ->
io:format("Could not find epmd.~n"),
halt(1);
GlobalEpmd ->
GlobalEpmd
end;
Epmd ->
Epmd
end.


nodename(Name) ->
case string:tokens(Name, "@") of
[_Node, _Host] ->
Expand Down

0 comments on commit b894682

Please sign in to comment.