zhong ming wu | 1 Dec 2010 03:33
Picon

a few questions or feature request on ejabberd

Dear List

I am an inexperienced xmpp server and ejabberd user.

If I rely on another database via external auth mechanism, what other
data (apart from jid/password information which
is stored in another database like mysql/postgresql) ejabberd is
storing in mnesia?  I am guessing that mnesia is storing
as yet undelivered message and offline messages in this case.

If I use ejabberd with odbc support then does that mean that it's not
using mnesia for any datastorage related to xmpp
server?

I am currently successfully using external auth mechanism to query
data from a DB; that script contains a check against both
jid/password for 'auth' part and jid alone for 'isuser' part.  Given
that domain is already in the jid, why is there a need to have
"host" directive in the ejabberd.cfg.  The reason I ask is that I
would like to be able to add/delete the domains ejabberd is hosting
without having to modifying the ejabberd.cfg and then restarting the
server.  Is there a plan to have feature like
{host, ["*"]}?  Or is there way make a query to an external database
for the valid host?

Thanks for your help

Mr. Wu
Badlop | 1 Dec 2010 13:34
Picon

Re: TURN configuration ?

2010/11/30 tom <at> diogunix.com <tom <at> diogunix.com>:
> Is there this time an option to also run a TURN service provided by ejabberd
> or additional tools ?

TURN support is planned, but not yet fully implemented, see:
https://support.process-one.net/browse/EJAB-1017

---
Badlop
ProcessOne
Badlop | 1 Dec 2010 13:45
Picon

Re: a few questions or feature request on ejabberd

2010/12/1 zhong ming wu <mr.z.m.wu <at> gmail.com>:
> I would like to be able to add/delete the domains ejabberd is hosting
> without having to modifying the ejabberd.cfg and then restarting the
> server.

That feature is planned, half implemented in ejabberd master,
but not yet usable.

There is a ticket with an old tricky patch which doesn't fully work:
https://support.process-one.net/browse/EJAB-284

>  Is there a plan to have feature like {host, ["*"]}?

No.

---
Badlop
ProcessOne
_______________________________________________
ejabberd mailing list
ejabberd <at> jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Manuel DE FERRAN | 1 Dec 2010 17:03

How to change mnesia table type by command line ?

Greetings,

I'm running a single node ejabberd instance 2.1.5 on top of erlang R14a.
I'm trying to change disc_copies mnesia tables to ram_copies. But I'd like to do it with a script.

I tried :
erl -home /var/lib/ejabberd -name ejabberddebug -setcookie mycookie -remsh ejabberd <at> node01 -s mnesia -run mnesia info

I tried to pipe "mnesia:info()." to ejabberdctl debug, with no luck too.

What is the easiest way to do it ?

_______________________________________________
ejabberd mailing list
ejabberd <at> jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
Spencer Cheng | 1 Dec 2010 18:49

Transient TCP error

I've managed to solve my earlier problems with xmpp messages being lost and connection being dropped. Some
of the problem was related to pure message volume which I have reduced.

My next problem is that I am getting occasional transient errors in setting up TCP connections. This is
causing 404 error to be returned to xmpp client. The logs looks like this.

> =INFO REPORT==== 2010-12-01 23:11:28 ===
> D(<0.414.0>:ejabberd_s2s_out:268) : s2s_out: connecting to {10,10,168,63}:5269
> 
> 
> =INFO REPORT==== 2010-12-01 23:11:28 ===
> D(<0.414.0>:ejabberd_socket:172) : Error in gen_tcp:send: {error,closed}
> 
> =INFO REPORT==== 2010-12-01 23:11:28 ===
> D(<0.414.0>:ejabberd_s2s_out:861) : terminated: {normal,open_socket}
> 

Ejabberd succeeds in subsequent TCP connection requests to the same remote ejabberd server. There are no
logs on the remote server to indicate whether an TCP connection attempt has even being attempted around
that timestamp.

I've looked through all the relevant logs in /var/log but there is nothing to indicate any sort of network
error. 

Does anyone has any suggestions as to how to debug this further? I am trying to determine if this is a H/W or S/W
problem. I set the log level to 5. Is there a higher level?

Ejabberd version - 2.1.5.
Ubuntu server 10.04.1 LTS

Regards,
Spencer Cheng
Badlop | 1 Dec 2010 19:28
Picon

Re: How to change mnesia table type by command line ?

2010/12/1 Manuel DE FERRAN <mdeferran <at> ubikod.com>:
> I'm trying to change disc_copies mnesia tables to ram_copies. But I'd like
> to do it with a script.

If I understood correctly, you want to do something like:
ejabberdctl mnesia_change_tabletype bytestream disc_only_copies

You can apply this patch to ejabberd 2.1.x (or to 2.1.5, or manually
to mod_admin_extra):

-------------------
--- a/src/ejabberd_admin.erl
+++ b/src/ejabberd_admin.erl
 <at>  <at>  -47,6 +47,7  <at>  <at> 
         install_fallback_mnesia/1,
         dump_to_textfile/1, dump_to_textfile/2,
         mnesia_change_nodename/4,
+        mnesia_change_tabletype/2,
         restore/1 % Still used by some modules
        ]).

 <at>  <at>  -173,6 +174,13  <at>  <at>  commands() ->
                        args = [{oldnodename, string}, {newnodename, string},
                                {oldbackup, string}, {newbackup, string}],
                        result = {res, restuple}},
+
+     #ejabberd_commands{name = mnesia_change_tabletype, tags = [mnesia],
+                       desc = "Change the type of a mnesia table in
the local node",
+                       module = ?MODULE, function = mnesia_change_tabletype,
+                       args = [{table, string}, {type, string}],
+                       result = {res, rescode}},
+
      #ejabberd_commands{name = backup, tags = [mnesia],
                        desc = "Store the database to backup file",
                        module = ?MODULE, function = backup_mnesia,
 <at>  <at>  -582,3 +590,8  <at>  <at>  mnesia_change_nodename(FromString, ToString,
Source, Target) ->
                {[Other], Acc}
        end,
     mnesia:traverse_backup(Source, Target, Convert, switched).
+
+mnesia_change_tabletype(TableS, TypeS) ->
+    {atomic, ok} = mnesia:change_table_copy_type(list_to_atom(TableS),
+                                                node(), list_to_atom(TypeS)),
+    ok.

-------------------

---
Badlop
ProcessOne
David Mohr | 1 Dec 2010 22:02

Re: Importing roaster from piefxis

On Wed, 2010-12-01 at 00:58 +0100, Badlop wrote:
> 2010/11/30 David Mohr <damailings <at> mcbf.net>:
> > # ejabberdctl import_piefxis ~/david.xml
> >
> > =INFO REPORT==== 30-Nov-2010::22:58:49 ===
> > D(<4605.501.0>:ejabberd_commands:314) : Executing command
> > ejabberd_piefxis:import_file with Args=["/root/david.xml"]
> > ** at node ejabberd <at> seeker **
> > Problem 'error badarg' occurred executing the command.
> > Stacktrace: [{erlang,binary_to_list,[none]},
> >             {ejabberd_piefxis,add_user,2},
> >             {ejabberd_piefxis,process_element,2},
> >             {lists,foldl,3},
> >             {ejabberd_piefxis,read_chunks,2},
> >             {ejabberd_piefxis,import_file,2},
> >             {ejabberd_ctl,call_command,3},
> >             {ejabberd_ctl,try_call_command,3}]
> >
> > So this looks to me like it's trying to create the user when all I want
> > is to import the roster.
> 
> Right. I imagine in your XML, the User element doesn't contain the
> Password attribute.

That's correct, since it's not available in the source jabber server.

> > How else can I import a roaster while using
> > ldap for authentication?
> 
> I've implemented support for your case.
> You can apply this patch to your ejabberd source code:
> https://git.process-one.net/ejabberd/mainline/commit/955343f6aae5224e215181f826350a0d5e2def1f
> Then try again to import your file.

For some strange reason the patch didn't apply against 2.1.5, but since
it wasn't very large I applied it manually.

Works nicely, thank you for writing it Badlop!

~David
Badlop | 2 Dec 2010 00:06
Picon

Re: Automated tests.

2010/11/20 Inoshiro Linden <inoshiro <at> lindenlab.com>:
> I am writing some modifications to ejabberd.  Is there an automated
> test framework?  I do not see an obvious one, though I am new to
> erlang.

In case you are still wondering about that.

From what I know, there are three test frameworks for erlang code:
* EUnit: http://www.erlang.org/doc/apps/eunit/chapter.html
* Common Test: http://www.erlang.org/doc/apps/common_test/basics_chapter.html
* Quickcheck (proprietary): http://www.quviq.com/

I cannot offer you hints and recommendation because I didn't yet use
any of them.

No test framework is used in ejabberd yet.

BTW, I'm using Dialyzer
http://www.erlang.org/doc/apps/dialyzer/dialyzer_chapter.html
in ejabberd master branch, but that doesn't count as a testing
framework I guess.

---
Badlop
ProcessOne
_______________________________________________
ejabberd mailing list
ejabberd <at> jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd
tom@diogunix.com | 2 Dec 2010 05:20

Re: TURN configuration ?

Hello Badlop,

many thanks

> 2010/11/30 tom <at> diogunix.com <tom <at> diogunix.com>:
> > Is there this time an option to also run a TURN service provided by
> > ejabberd or additional tools ?
> 
> TURN support is planned, but not yet fully implemented, see:
> https://support.process-one.net/browse/EJAB-1017

I've downloaded the latest stun.tar.gz archive from there and checked the 
contents.

As I'm not already familiar with the Erlang specialties - can you give me a 
hint on how to properly deploy these files for tests of TURN functionality ? 

Many thanks in advance
Tom
Manuel DE FERRAN | 2 Dec 2010 08:49

Re: How to change mnesia table type by command line ?


On Wed, Dec 1, 2010 at 7:28 PM, Badlop <badlop <at> gmail.com> wrote:
2010/12/1 Manuel DE FERRAN <mdeferran <at> ubikod.com>:
> I'm trying to change disc_copies mnesia tables to ram_copies. But I'd like
> to do it with a script.

If I understood correctly, you want to do something like:
ejabberdctl mnesia_change_tabletype bytestream disc_only_copies

You can apply this patch to ejabberd 2.1.x (or to 2.1.5, or manually
to mod_admin_extra):


Great, thanks.

I kept digging and I tried the following erlang lines :

 -module(mychangetabletype).
-export([setLocalRamCopies/0]).
setLocalRamCopies() ->
  mnesia:start(),
  mnesia:change_table_copy_type(acl, node(), ram_copies),
  mnesia:change_table_copy_type(config, node(), ram_copies),
  mnesia:change_table_copy_type(local_config, node(), ram_copies),
  mnesia:change_table_copy_type(passwd, node(), ram_copies).

erlc mychangetabletype.erl

It works as expected on ejabberdctl debug, but it does not work when called with :
/etc/init.d/ejabberd stop
erl  -pa '/tmp' -home /var/lib/ejabberd -name ejabberd <at> node01 -setcookie mycookie  -mnesia dir "'/var/lib/ejabberd'" -run mychangetabletype setLocalRamCopies

I tried also without mnesia:start() in the script and adding -s mnesia to the command line.

Looks like mnesia is not initialized yet or smth like that.

I'm wondering why it does not work.
_______________________________________________
ejabberd mailing list
ejabberd <at> jabber.ru
http://lists.jabber.ru/mailman/listinfo/ejabberd

Gmane