Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The best guide I could find at time of writing (  ) is the OpenLDAP-POSTGRESQL HOWTO, written in 2001 and last updated in 2012.  The HOWTO still fares well, given its age. It is weakest in the beginning, giving (I think) too many odbc options, some outdated advice, and too much compiling-from-source. Its strongest section is the last, a live example from a production system.  This guide will attempt to

Now install the built packages:

Recompile OpenLDAP with the SQL backend (back-sql)

First, get the OpenLDAP package source:

Code Block
apt install dpkg-dev devscripts                    # Requirements for fetching and building source packages
vim /etc/apt/sources.list                          # Uncomment the deb-src line to enable fetching source packages
apt update                                         # Refresh package cache
mkdir openldap
cd openldap
apt source openldap
cd openldap-2.4.49+dfsg
apt build-dep slapd                                # Get build-time dependencies of OpenLDAP
echo '--enable-sql' >> debian/configure.options    # Enable SQL backend, which is why we're recompiling
DEB_BUILD_OPTIONS='nostrip noopt parallel=4 nocheck' DFSG_NONFREE=true debuild --no-lintian -i -us -uc -b


The final build command needs a bit of explanation:

  • -us  is --unsigned-source – do not sign the source package
    -uc  is --unsigned-changes
    -b  is --build=binary
    -i  is passed to dpkg-source
    --no-lintian prevents a slow 'lint' operation
  • DFSG_NONFREE=true  prevents the build breaking (can't remember why - check debian/rules)
  • Within DEB_BUILD_OPTIONS:
    nostrip noopt  leaves debug symbols in the resulting binaries. This is needed for later running slapd under 'gdb', which is something you're unfortunately likely to need.
    parallel=4  speed up the build a bit
    nocheck  avoid running the tests on every build. For slapd they are very slow.

Now install the built packages:

code
Code Block
apt install psmisc                            # This is a runtime dependency of slapd. Normally when you 'apt install slapd' this dependency is fetched automatically; however since we're installing directly ('dpkg -i') we need to install it manually.
dpkg -i ../*.deb                                # Install OpenLDAP packages we just built.


Ensure that slapd was built with 'sql' support:

...