[erlang-questions] "Kernel pid terminated" error getting release to run (newbie)
Ransom Richardson
ransomr@REDACTED
Tue Feb 7 00:32:32 CET 2012
I'm building my first non-trivial Erlang application. I've gotten it working in the shell. Now I'm trying to build a release using rebar. "rebar generate" succeeds, but when I try to run the application I get the error below. I'm trying to follow these tutorials:
http://www.metabrew.com/article/erlang-rebar-tutorial-generating-releases-upgrades
http://alancastro.org/2010/05/01/erlang-application-management-with-rebar.html
I have named both my application and my node "session". The error seems rather unhelpful, so any suggestions on how to debug are appreciated.
thanks,
Ransom
cocomo@REDACTED:~/dev/talko/service/session$ ./rel/session/bin/session console
Exec: /home/cocomo/dev/talko/service/session/rel/session/erts-5.9/bin/erlexec -boot /home/cocomo/dev/talko/service/session/rel/session/releases/1/session -mode embedded -config /home/cocomo/dev/talko/service/session/rel/session/releases/1/sys.config -args_file /home/cocomo/dev/talko/service/session/rel/session/releases/1/vm.args -- console
Root: /home/cocomo/dev/talko/service/session/rel/session
Erlang R15B (erts-5.9) [source] [smp:2:2] [async-threads:0] [hipe] [kernel-poll:false]
1
2
=INFO REPORT==== 6-Feb-2012::18:15:15 ===
application: session
exited: {shutdown,{session_app,start,[normal,[]]}}
type: permanent
Eshell V5.9 (abort with ^G)
(session@REDACTED)1> {"Kernel pid terminated",application_controller,"{application_start_failure,session,{shutdown,{session_app,start,[normal,[]]}}}"}
Crash dump was written to: erl_crash.dump
Kernel pid terminated (application_controller) ({application_start_failure,session,{shutdown,{session_app,start,[normal,[]]}}})
FILE session_app.erl
-module(session_app).
-behaviour(application).
%% Application callbacks
-export([start/0, start/2, stop/1]).
%% ===================================================================
%% Application callbacks
%% ===================================================================
%% start/0 is only to use for testing in the shell
start() ->
{ok, Pid} = session_sup:start_link(),
unlink(Pid).
start(_StartType, _StartArgs) ->
session_sup:start_link().
stop(_State) ->
ok.
FILE session_sup.erl
-module(session_sup).
-behaviour(supervisor).
%% API
-export([start_link/0]).
%% Supervisor callbacks
-export([init/1]).
%% Helper macro for declaring children of supervisor
-define(CHILD(I, Type), {I, {I, start_link, []}, permanent, 5000, Type, [I]}).
%% ===================================================================
%% API functions
%% ===================================================================
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
%% ===================================================================
%% Supervisor callbacks
%% ===================================================================
init([]) ->
Controller = ?CHILD(controller, worker),
{ok, { {one_for_one, 5, 10}, [Controller]} }.
FILE reltool.config
{sys, [
{lib_dirs, ["../../"]},
{erts, [{mod_cond, derived}, {app_file, strip}]},
{app_file, strip},
{rel, "session", "1",
[
kernel,
stdlib,
sasl,
session
]},
{rel, "start_clean", "",
[
kernel,
stdlib
]},
{boot_rel, "session"},
{profile, embedded},
{incl_cond, exclude},
{excl_archive_filters, [".*"]}, %% Do not archive built libs
{excl_sys_filters, ["^bin/.*", "^erts.*/bin/(dialyzer|typer)",
"^erts.*/(doc|info|include|lib|man|src)"]},
{excl_app_filters, ["\.gitignore"]},
{app, sasl, [{incl_cond, include}]},
{app, stdlib, [{incl_cond, include}]},
{app, kernel, [{incl_cond, include}]},
{app, session, [{incl_cond, include}]}
]}.
{target_dir, "session"}.
{overlay, [
{mkdir, "log/sasl"},
{copy, "files/erl", "\{\{erts_vsn\}\}/bin/erl"},
{copy, "files/nodetool", "\{\{erts_vsn\}\}/bin/nodetool"},
{copy, "files/session", "bin/session"},
{copy, "files/sys.config", "releases/\{\{rel_vsn\}\}/sys.config"},
{copy, "files/session.cmd", "bin/session.cmd"},
{copy, "files/start_erl.cmd", "bin/start_erl.cmd"},
{copy, "files/vm.args", "releases/\{\{rel_vsn\}\}/vm.args"}
]}.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120206/48999274/attachment.htm>
More information about the erlang-questions
mailing list