Making ejabberd run on LING VM
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
src starts ejabberd Feb 26, 2013
jabberling.xml ejabberd login successful Feb 28, 2013
rebar.config xml parser coding done Feb 27, 2013

Making ejabberd run on LING VM

The log of changes follows:

  • rebar

A standard source of ejabberd from P1 ( does not work with rebar. There are a couple of "rebarized" versions. I took the one by treacheroustalks ( There is also a required companion application, stringprep ( Both added as rebar dependencies.

  • c_src

c_src directories of both ejabberd and stringprep are moved to __REMOVED directory. rebar builds everything cleanly.

  • standard deps

The following application dependencies found: sasl, crypto, public_key, ssl, mnesia. All this applications are imported to the image and start successfully.

  • stringprep

Yet another dependency is stringprep. The purpose of the application is not clear. It is rewritten not to use driver and spew arguments of all calls.

  • ejabberd_loglevel

application:start(ejabberd) fails because ejabberd_loglevel.erl uses a dynamic compilation (for efficiency?). Upon initialization ejabberd_loglevel:set(4) is called. The ejabberd_logger.erl module that corresponds to this level is generated and added to the source tree. The module is also added to

  • db_init

ejabberd_app:db_init restarts mnesia. Calling application:stop(mnesia) leads to a complete shutdown. The shutdown was due to a bug in process_info(_, group_leader). mnesia restarts cleanly now.

  • sha

Module sha loads a driver. sha.erl heavily edited to use standard crypto:* routines and not load the driver.

  • xml

A possibility to use --enable-nif removed in xml.erl. File xml.c removed.

  • drivers

The start sequence starts tls_drv and expat_erl drivers. The line is commented out. Another line that loads ASN1.0 driver commented out too because it produces a deprecated message (and is noop).

  • mnesia

Mnesia creates a subdirectory in the project directory. The project directory is not writable. A writable directory is mounted over 9p and designated as a database directory to Mnesia.

  • missing

ejabberd uses system\monitor() functions. Functions are stubbed and do nothing. When opening a listening socket it sets the send timeout. The TCP driver updated to support the option fully. mod_caps wants to know the number of logical processors. system_info(logical_processors) always returns 1.

  • starts

ejabberd now starts. The admin user is added and admin console is accessible at port 5280.

  • expat

A c2s listener is configured on c2s. An attempt to connect fails because expat driver is not present/known. xml_stream.erl reimplemented using xmerl as xmerl_sax_parser offers functionality almost identical to the expat driver.

  • tls

tls driver hit upon connection attempt. tls and starttls removed from the listener to enable unencrypted connection. After a couple of more bugs it is now possible to login to the server.

  • DONE