# Erlang in VImage jail crashes



## tty23 (Jan 12, 2010)

I created a vimage jail and installed Erlang in order to run ejabberd.

Unfortunately Erlang crashes every time when trying to create an network
socket (actually the empd deamon tries to do that, this is triggered by adding 
the -sname name parameter).
My guess is that some information that Erlang need to figure out the addresses
to bind to are not accessible in the jail.
I already allowed raw sockets (enabled it in the main system, and in the jail configuration) which did not help. I cannot use dtrace to find out more about
the problem, as dtrace does not work in the jail.
Any ideas? Should I rather ask this question on some Erlang forum?


```
erl -sname test  
{error_logger,{{2010,1,12},{1,0,28}},"Protocol: ~p: register error: ~p~n",
["inet_tcp",{{badmatch,{error,eacces}},[{inet_tcp_dist,listen,1},{net_kernel,start_protos,4},
{net_kernel,start_protos,3},{net_kernel,init_node,2},{net_kernel,init,1},
{gen_server,init_it,6},{proc_lib,init_p_do_apply,3}]}]}
{error_logger,{{2010,1,12},{1,0,28}},crash_report,
[[{initial_call,{net_kernel,init,['Argument__1']}},{pid,<0.20.0>},{registered_name,[]},
{error_info,{exit,{error,badarg},[{gen_server,init_it,6},{proc_lib,init_p_do_apply,3}]}}
,{ancestors,[net_sup,kernel_sup,<0.9.0>]},{messages,[]},
{links,[#Port<0.62>,<0.17.0>]},{dictionary,[{longnames,false}]},{trap_exit,true},
{status,running},{heap_size,377},{stack_size,24},{reductions,438}],[]]}
{error_logger,{{2010,1,12},{1,0,28}},supervisor_report,
[{supervisor,{local,net_sup}},{errorContext,start_error},
{reason,{'EXIT',nodistribution}},{offender,[{pid,undefined},{name,net_kernel},
{mfa,{net_kernel,start_link,[[test,shortnames]]}},{restart_type,permanent},
{shutdown,2000},{child_type,worker}]}]}
{error_logger,{{2010,1,12},{1,0,28}},supervisor_report,
[{supervisor,{local,kernel_sup}},{errorContext,start_error},{reason,shutdown},
{offender,[{pid,undefined},{name,net_sup},{mfa,{erl_distribution,start_link,[]}},
{restart_type,permanent},{shutdown,infinity},{child_type,supervisor}]}]}
{error_logger,{{2010,1,12},{1,0,28}},std_info,[{application,kernel},
{exited,{shutdown,{kernel,start,[normal,[]]}}},{type,permanent}]}
{"Kernel pid terminated",application_controller,"{application_start_failure,kernel,
{shutdown,{kernel,start,[normal,[]]}}}"}

Crash dump was written to: erl_crash.dump
Kernel pid terminated (application_controller) 
({application_start_failure,kernel,{shutdown,{kernel,start,[normal,[]]}}})
```


----------



## tty23 (Jan 12, 2010)

I found the reason: The domainname was not set in the jail. Now that I set the name, erlang works fine.


----------

