# ejabberd: "Kernel pid terminated"

## Kenji Miyamoto

I'm trying to set ejabberd up, but get the following when trying to run it: 

```
# ejabberd

{error_logger,{{2008,1,20},{10,29,36}},"Protocol: ~p: register error: ~p~n",["inet_tcp",{{badmatch,{error,duplicate_name}},

[{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,5}]}]}

{error_logger,{{2008,1,20},{10,29,36}},crash_report,[[{pid,<0.21.0>},{registered_name,net_kernel},{error_info,{exit,{error,badarg},[{gen_server,init_it,6},

{proc_lib,init_p,5}]}},{initial_call,{gen,init_it,[gen_server,<0.18.0>,<0.18.0>,{local,net_kernel},net_kernel,{ejabberd,shortnames,15000},[]]}},

{ancestors,[net_sup,kernel_sup,<0.8.0>]},{messages,[]},{links,[#Port<0.7>,<0.18.0>]},{dictionary,[{longnames,false}]},{trap_exit,true},

{status,running},{heap_size,610},{stack_size,23},{reductions,437}],[]]}

{error_logger,{{2008,1,20},{10,29,36}},supervisor_report,[{supervisor,{local,net_sup}},{errorContext,start_error},{reason,{'EXIT',nodistribution}},

{offender,[{pid,undefined},{name,net_kernel},{mfa,{net_kernel,start_link,[[ejabberd,shortnames]]}},{restart_type,permanent},{shutdown,2000},{child_type,worker}]}]}

{error_logger,{{2008,1,20},{10,29,36}},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,{{2008,1,20},{10,29,36}},crash_report,[[{pid,<0.7.0>},{registered_name,[]},{error_info,{exit,{shutdown,{kernel,start,[normal,[]]}},

[{application_master,init,4},{proc_lib,init_p,5}]}},{initial_call,{application_master,init,[<0.5.0>,<0.6.0>,{appl_data,kernel,[application_controller,erl_reply,auth,boot_server,code_server,disk_log_server,disk_log_sup,

erl_prim_loader,error_logger,file_server_2,fixtable_server,global_group,global_name_server,heart,init,kernel_config,kernel_sup,net_kernel,net_sup,rex,user,os_server,ddll_server,erl_epmd,inet_db,pg2],undefined,

{kernel,[]},[application,application_controller,application_master,application_starter,auth,code,code_aux,packages,code_server,dist_util,erl_boot_server,erl_distribution,erl_prim_loader,erl_reply,erlang,

error_handler,error_logger,file,file_server,file_io_server,prim_file,global,global_group,global_search,group,heart,hipe_unified_loader,inet6_tcp,inet6_tcp_dist,inet6_udp,inet_config,inet_hosts,inet_gethost_native,

inet_tcp_dist,init,kernel,kernel_config,net,net_adm,net_kernel,os,ram_file,rpc,user,user_drv,user_sup,disk_log,disk_log_1,disk_log_server,disk_log_sup,dist_ac,erl_ddll,erl_epmd,erts_debug,gen_tcp,gen_udp,g

en_sctp,prim_inet,inet,inet_db,inet_dns,inet_parse,inet_res,inet_tcp,inet_udp,inet_sctp,pg2,seq_trace,wrap_log_reader,zlib,otp_ring0],[],infinity,infinity},normal]}},{ancestors,[<0.6.0>]},{messages,[{'EXIT',<0.8.0>,normal}]},

{links,[<0.6.0>,<0.5.0>]},{dictionary,[]},{trap_exit,true},{status,running},{heap_size,987},{stack_size,23},{reductions,124}],[]]}

{error_logger,{{2008,1,20},{10,29,36}},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,[]]}}})
```

/etc/jabber/ejabberd.cfg:

```
% $Id: ejabberd.cfg.example 577 2006-06-07 08:38:37Z mremond $

%override_acls.

% Users that have admin access.  Add line like one of the following after you

% will be successfully registered on server to get admin access:

{acl, admin, {user, "neil"}}.

%{acl, admin, {user, "ermine"}}.

% Blocked users:

%{acl, blocked, {user, "test"}}.

% Local users:

{acl, local, {user_regexp, ""}}.

% Another examples of ACLs:

%{acl, jabberorg, {server, "jabber.org"}}.

%{acl, aleksey, {user, "aleksey", "jabber.ru"}}.

%{acl, test, {user_regexp, "^test"}}.

%{acl, test, {user_glob, "test*"}}.

% Everybody can create pubsub nodes

{access, pubsub_createnode, [{allow, all}]}.

% Only admins can use configuration interface:

{access, configure, [{allow, admin}]}.

% Every username can be registered via in-band registration:

% You could replace {allow, all} with {deny, all} to prevent user from using

% in-band registration

{access, register, [{allow, all}]}.

% After successful registration user will get message with following subject

% and body:

{welcome_message,

 {"Welcome!",

  "Welcome to Jabber Service.  "

  "For information about Jabber visit http://jabber.org"}}.

% Replace them with 'none' if you don't want to send such message:

%{welcome_message, none}.

% List of people who will get notifications about registered users

%{registration_watchers, ["admin1@localhost",

%                         "admin2@localhost"]}.

% Only admins can send announcement messages:

{access, announce, [{allow, admin}]}.

% Only non-blocked users can use c2s connections:

{access, c2s, [{deny, blocked},

          {allow, all}]}.

% Set shaper with name "normal" to limit traffic speed to 1000B/s

{shaper, normal, {maxrate, 1000}}.

% Set shaper with name "fast" to limit traffic speed to 50000B/s

{shaper, fast, {maxrate, 50000}}.

% For all users except admins used "normal" shaper

{access, c2s_shaper, [{none, admin},

            {normal, all}]}.

% For all S2S connections used "fast" shaper

{access, s2s_shaper, [{fast, all}]}.

% Admins of this server are also admins of MUC service:

{access, muc_admin, [{allow, admin}]}.

% All users are allowed to use MUC service:

{access, muc, [{allow, all}]}.

% This rule allows access only for local users:

{access, local, [{allow, local}]}.

% Authentication method.  If you want to use internal user base, then use

% this line:

%{auth_method, internal}.

% For LDAP authentication use these lines instead of above one:

%{auth_method, ldap}.

%{ldap_servers, ["localhost"]}.    % List of LDAP servers

%{ldap_uidattr, "uid"}.            % LDAP attribute that holds user ID

%{ldap_base, "dc=example,dc=com"}. % Search base of LDAP directory

%{ldap_rootdn, "dc=example,dc=com"}. % LDAP manager

%{ldap_password, "******"}. % Password to LDAP manager

% For authentication via external script use the following:

%{auth_method, external}.

%{extauth_program, "/path/to/authentication/script"}.

% For authentication via ODBC use the following:

%{odbc_server, "DSN=ejabberd;UID=ejabberd;PWD=PASSWORD1"}.

{auth_method, odbc}.

{odbc_server, {pgsql, "localhost", "ejabberd", "ejabberd", "PASSWORD1"}}.

% Host name:

{hosts, ["kenji-m.zapto.org"]}.

%% Define the maximum number of time a single user is allowed to connect:

{max_user_sessions, 10}.

%% Anonymous login support:

%%  auth_method: anonymous

%%  anonymous_protocol: sasl_anon|login_anon|both

%%  allow_multiple_connections: true|false

%%{host_config, "public.example.org", [{auth_method, anonymous},

%%                                     {allow_multiple_connections, false},

%%                                     {anonymous_protocol, sasl_anon}]}.

%% To use both anonymous and internal authentication:

{host_config, "kenji-m.zapto.org", [{auth_method, [odbc]}]}.

% Default language for server messages

{language, "en"}.

% Listened ports:

{listen,

 [{5222, ejabberd_c2s,     [{access, c2s}, {shaper, c2s_shaper},

             {max_stanza_size, 65536},

             starttls, {certfile, "/etc/jabber/kenji-m.zapto.org.pem"}]},

  {5223, ejabberd_c2s,     [{access, c2s},

             {max_stanza_size, 65536},

             tls, {certfile, "/etc/jabber/kenji-m.zapto.org"}]},

  % Use these two lines instead if TLS support is not compiled

  %{5222, ejabberd_c2s,     [{access, c2s}, {shaper, c2s_shaper}]},

  %{5223, ejabberd_c2s,     [{access, c2s}, ssl, {certfile, "/etc/jabber/kenji-m.zapto.org.pem"}]},

  {5269, ejabberd_s2s_in,  [{shaper, s2s_shaper},

             {max_stanza_size, 131072}

            ]},

  {5280, ejabberd_http,    [http_poll, web_admin]},

  {8888, ejabberd_service, [{access, all},

             {hosts, ["icq.localhost", "sms.localhost"],

              [{password, "PASSWORD2"}]}]}

 ]}.

% Use STARTTLS+Dialback for S2S connections

{s2s_use_starttls, false}.

%{s2s_use_starttls, true}.

%{s2s_certfile, "./ssl.pem"}.

%{domain_certfile, "example.org", "./example_org.pem"}.

%{domain_certfile, "example.com", "./example_com.pem"}.

% If SRV lookup fails, then port 5269 is used to communicate with remote server

{outgoing_s2s_port, 5269}.

% Used modules:

{modules,

 [

  {mod_register,   [{access, register}]},

  {mod_roster,     []},

  {mod_privacy,    []},

  {mod_adhoc,      []},

  {mod_configure,  []}, % Depends on mod_adhoc

  {mod_configure2, []},

  {mod_disco,      []},

  {mod_stats,      []},

  {mod_vcard,      []},

  {mod_offline,    []},

  {mod_announce,   [{access, announce}]}, % Depends on mod_adhoc

  {mod_echo,       [{host, "echo.localhost"}]},

  {mod_private,    []},

  {mod_irc,        []},

% Default options for mod_muc:

%   host: "conference." ++ ?MYNAME

%   access: all

%   access_create: all

%   access_admin: none (only room creator has owner privileges)

  {mod_muc,        [{access, muc},

          {access_create, muc},

          {access_admin, muc_admin}]},

%  {mod_muc_log,    []},

%  {mod_shared_roster, []},

  {mod_pubsub,     [{access_createnode, pubsub_createnode}]},

  {mod_time,       []},

  {mod_last,       []},

  {mod_version,    []}

 ]}.

% Local Variables:

% mode: erlang

% End:
```

I've already run this for Postgres, too (in the ejabberd source directory):

```
psql -U ejabberd ejabberd < src/odbc/pg.sql
```

What could be the problem?  I can't figure it out from the log.

----------

## jouva

Bumping old post. Sorry.

You may already have it running: http://www.ejabberd.im/error/duplicate_name

Check if it is with this:

```

ps aux | grep jabber | grep -v grep

```

If you have more than epmd running it's already running. If it can't connect, kill any of those processes and do:

```

/etc/init.d/ejabberd zap

/etc/init.d/ejabberd start

```

Then run the ps line again to see if it's running.

----------

