Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 591862 - net-im/ejabberd-16.04: does not work with ldap net-nds/openldap
Summary: net-im/ejabberd-16.04: does not work with ldap net-nds/openldap
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Amadeusz Żołnowski (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-22 14:59 UTC by Mike Hiretsky
Modified: 2016-09-14 06:39 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Hiretsky 2016-08-22 14:59:35 UTC
Ebuild ejabberd-16.04 installs ejabber files into /usr/lib/erlang/libs/ejabberd-16.04 instead /usr/lib/erlang/libs/ejabberd/ejabberd-16.04 (as ejabberd-16.01). As a result ejabber use /usr/lib/erlang/lib/eldap-1.2.1 instead internal eldap.

dev-lang/erlang-18.3
net-im/ejabberd-16.04
net-nds/openldap-2.4.38-r2
Comment 1 Amadeusz Żołnowski (RETIRED) gentoo-dev 2016-08-23 20:40:38 UTC
If you temporarily move /usr/lib/erlang/lib/eldap-1.2.1 somewhere else, does ejabberd work?

The fix would be to either force to include local eldap.hrl somehow, or rename eldap modules to e.g. ejabberd_eldap.
Comment 2 Dirk Olmes 2016-08-25 06:36:20 UTC
I just stumbled over a similar bug. Some googling found an issue on github (https://github.com/processone/ejabberd/issues/1037) which suggests moving /usr/lib/erlang/lib/eldap-1.2.1 aside. If I do that, ejabberd works just fine with LDAP.

It seems that the eldap module is part of the dev-lang/erlang build. Maybe an LDAP use flag would be due?
Comment 3 Amadeusz Żołnowski (RETIRED) gentoo-dev 2016-08-25 20:00:45 UTC
Moving out eldap shipped with erlang is only a workaround, as well as not installing it would be a workaround. Erlang should first look into internal modules to include. I have discussed the issue on #ejabberd and I think I know how to fix the issue:

1) Move out ejabberd from /usr/lib/erlang/lib. It doesn't belong there, actually, because it's not a lib. But that wouldn't solve the issue, yet.
2) Set ERL_LIBS path to prefer ejabberd path over /usr/lib/erlang/lib.

I will try to fix the issue as soon as possible, but certainly not today.
Comment 4 Amadeusz Żołnowski (RETIRED) gentoo-dev 2016-08-25 20:02:02 UTC
Dirk, thank for confirming that workaround works. That confirms the bug origin.
Comment 5 Amadeusz Żołnowski (RETIRED) gentoo-dev 2016-08-27 08:35:40 UTC
There's also another thing I would like you guys to test. Please revert everything to original state (move eldap-1.2.1 back to /usr/lib/erlang/lib/). Then please change ERL_LIBS in ejabberdctl to point to ejabber-16.04 directory first:

    sed -r -e 's@^(ERL_LIBS)=(.*)$@\1=/usr/lib/erlang/lib/ejabberd-16.04:\2@' -i /usr/sbin/ejabberdctl

You should end up with:

    ERL_LIBS=/usr/lib/erlang/lib/ejabberd-16.04:/usr/lib64/ejabberd-16.04

or

    ERL_LIBS=/usr/lib/erlang/lib/ejabberd-16.04:/usr/lib64/ejabberd-16.04

If that works for you I will prepare the fix.
Comment 6 Amadeusz Żołnowski (RETIRED) gentoo-dev 2016-08-27 08:43:31 UTC
And second case to test: just set ERL_LIBS to ejabberd-16.04 directory:

    ERL_LIBS=/usr/lib/erlang/lib/ejabberd-16.04

I am not sure that pointing to /usr/lib/erlang/lib is needed at all. ejabberd starts for me with setting above.
Comment 7 Amadeusz Żołnowski (RETIRED) gentoo-dev 2016-08-27 08:48:53 UTC
Sorry, I've messed up the first test case. Forget. I will sum it up here:

1. Set ERL_LIBS to point directly to ejabberd dir:

   ERL_LIBS=/usr/lib/erlang/lib/ejabberd-16.04

2. If (1) doesn't work, set ERL_LIBS to:

   ERL_LIBS=/usr/lib/erlang/lib/ejabberd-16.04:/usr/lib/erlang/lib

You may need to change "/usr/lib" to "/usr/lib64" if for some reason you don't have the symlink.
Comment 8 Amadeusz Żołnowski (RETIRED) gentoo-dev 2016-08-27 13:32:50 UTC
I have fixed it in ejabberd-16.04-r1 with solution (2), but please test scenario (1) for me. You only need to stop ejabberd and epmd services, remove second path from ERL_LIBS in ejabberdctl (everything after and including ':') and then start ejabberd. For me both cases seem to work.
Comment 9 Dirk Olmes 2016-08-30 06:47:19 UTC
(In reply to Amadeusz Żołnowski from comment #8)
> I have fixed it in ejabberd-16.04-r1 with solution (2), but please test
> scenario (1) for me. You only need to stop ejabberd and epmd services,
> remove second path from ERL_LIBS in ejabberdctl (everything after and
> including ':') and then start ejabberd. For me both cases seem to work.

I tested scenario (1) (just ERL_LIBS=/usr/lib/erlang/lib/ejabberd-16.04) and my ejabberd started just fine.

IMHO solution (2) is safer because it does not change the default behaviour of ejabberdctl but just shuffles the search path a bit.
Comment 10 Hans de Graaff gentoo-dev Security 2016-09-08 14:21:17 UTC
I can confirm that 16.04 does not work for me with LDAP, but 16.04-r1 does. I never moved erlang files around and just installed 16.04 today (and 16.04-r1 afterwards).
Comment 11 Amadeusz Żołnowski (RETIRED) gentoo-dev 2016-09-14 06:39:15 UTC
Thanks for testing.