diff options
author | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2011-01-20 18:56:42 +0100 |
---|---|---|
committer | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2011-01-29 15:37:54 +0100 |
commit | b894682ba92baa0f258908cf5dacb5ec0cd14635 (patch) | |
tree | 0c26c9a814c21a1bf202d0b1395e874a05bdf113 /priv | |
parent | 926baa1c31940ba49bd8a798fe4a4efecb636420 (diff) |
Fix bug 294
Diffstat (limited to 'priv')
-rw-r--r-- | priv/templates/simplenode.nodetool | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/priv/templates/simplenode.nodetool b/priv/templates/simplenode.nodetool index cb524ce..0318ca1 100644 --- a/priv/templates/simplenode.nodetool +++ b/priv/templates/simplenode.nodetool @@ -7,6 +7,7 @@ %% ------------------------------------------------------------------- main(Args) -> + ok = start_epmd(), %% Extract the args {RestArgs, TargetNode} = process_args(Args, [], undefined), @@ -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] -> |