[ejabberd] Server2Server

Badlop badlop at gmail.com
Tue Oct 23 21:23:04 MSD 2007


2007/10/5, Denny Schierz <linuxmail at 4lin.net>:
> any suggestions?

I think you forgot to add the command line argument: -kernel inetrc
'"/path/to/inetrc-file"'

In ejabberd SVN all this is automatically handled by src/ejabberdctl.template

Here is a complete example that shows all the possibilities, and how
to get Erlang to resolve DNS SRV correctly even when using -sname.


 ---- With -name all works correctly:

$ erl -name aaa
Erlang (BEAM) emulator version 5.5.5 [source] [async-threads:0]
[kernel-poll:false]

Eshell V5.5.5  (abort with ^G)
(aaa at localhost.pike)1> inet_res:getbyname("_xmpp-server._tcp.gmail.com",srv).
{ok,{hostent,"_xmpp-server._tcp.gmail.com",
             [],
             srv,
             5,
             [{20,0,5269,"xmpp-server4.l.google.com"},
              {5,0,5269,"xmpp-server.l.google.com"},
              {20,0,5269,"xmpp-server1.l.google.com"},
              {20,0,5269,"xmpp-server2.l.google.com"},
              {20,0,5269,"xmpp-server3.l.google.com"}]}}
(aaa at localhost.pike)2> q().
ok


 --- With -sname DNS SRV is not resolved:

$ erl -sname aaa
Erlang (BEAM) emulator version 5.5.5 [source] [async-threads:0]
[kernel-poll:false]

Eshell V5.5.5  (abort with ^G)
(aaa at localhost)1> inet_res:getbyname("_xmpp-server._tcp.gmail.com",srv).
{error,timeout}
(aaa at localhost)2> q().
ok


 --- Let's prepare an inetrc file:

$ cat ejabberd.inetrc
{lookup,["file","native"]}.
{host,{127,0,0,1}, ["localhost","hostalias"]}.
{file, resolv, "/etc/resolv.conf"}.


 --- With -sname and the inetrc file, DNS SRV works again:

$ erl -sname aaa -kernel inetrc '"/path/to/ejabberd.inetrc"'
Erlang (BEAM) emulator version 5.5.5 [source] [async-threads:0]
[kernel-poll:false]

Eshell V5.5.5  (abort with ^G)
(aaa at localhost)1> inet_res:getbyname("_xmpp-server._tcp.gmail.com",srv).
{ok,{hostent,"_xmpp-server._tcp.gmail.com",
             [],
             srv,
             5,
             [{20,0,5269,"xmpp-server3.l.google.com"},
              {20,0,5269,"xmpp-server4.l.google.com"},
              {5,0,5269,"xmpp-server.l.google.com"},
              {20,0,5269,"xmpp-server1.l.google.com"},
              {20,0,5269,"xmpp-server2.l.google.com"}]}}
(aaa at localhost)2> q().
ok


More information about the ejabberd mailing list