Question

I'm configuring OPENLDAP 2.4.35. on Redhat Linux, I have already installed Berkley DB 4.8.30 as a prerequisite. I also checked the version compatibility from OPENLDAP's README file, which says:

    SLAPD:
    BDB and HDB backends require Oracle Berkeley DB 4.4 - 4.8,
    or 5.0 - 5.1.  It is highly recommended to apply the
    patches from Oracle for a given release.

Still I'm getting this error:

    checking db.h usability... yes
    checking db.h presence... yes
    checking for db.h... yes
    checking for Berkeley DB major version in db.h... 4
    checking for Berkeley DB minor version in db.h... 8
    checking if Berkeley DB version supported by BDB/HDB backends... yes
    checking for Berkeley DB link (-ldb-4.8)... yes
    *checking for Berkeley DB library and header version match... no
    configure: error: Berkeley DB version mismatch*

Kindly help

Was it helpful?

Solution

Now the configuration is working fine. I had to export the library path for Berkeley DB properly:

export LD_LIBRARY_PATH="/root/db-6.0.20/build_unix/.libs"

Edit :

The directory build_unix/.libs contains the necessary libs for OpenLDAP but also lots of other files produced during the Berkeley installation. I rather suggest to use the destination Berkeley lib directory which is created during the installation (it should be equal to PREFIX/lib), because you would remove/update your Berkeley source directory one day, breaking OpenLDAP runtime (see the end of my edit)

You can either export the LD_LIBRARY_PATH variable, or set it only at the configure time of OpenLDAP, this way :

LD_LIBRARY_PATH="/root/db-6.0.20.installed/lib" ./configure

Usually there would be other configuration options, I am omitting them here.

Once installed correctly, OpenLDAP may still fail to start with the following error message in the log :

5d34473d bdb_back_initialize: BDB library version mismatch: expected Berkeley DB 5.3.28: (September  9, 2013), got Berkeley DB 5.3.21: (May 11, 2012)

To solve this issue, the solution is again to force the LD_LIBRARY_PATH variable, this time in the startup script (wherever is yours, /etc/init.d/openldap for example). As we are talking about the runtime, it's important here to note we shouldn't call the build_unix/.libs directory which is considered temporary, but the created /lib directory.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top