Categories
Geeky

Ubuntu OpenLDAP with Static Config

The OpenLDAP package on Ubuntu Jaunty and newer set to online configuration as default. This lead to a huge flame war on forums and mailing lists since cannonical did not post an error free how-to or manual for setting up an OpenLDAP server so far. The best how-to’s I’ve found are:

Even though they fail when you want to add the nessesary schema for Samba services (samba.schema). Again, Cannonical does not provide an online schema file (in LDIF format) in the slapd or samba-doc package and simple conversion of the schema into online format failes due to dependency problems. So you basically need to write the whole configuration in a static slapd.conf and then convert the whole configuration into the online format at one go.

For simple directories, the online format has no (really no!) advantages compared to a statical configuration. So why go for the much more complex online config? But again, how to use static configs on Ubuntu?

The slapd binary uses the switch ‘-f” for static configuration and the switch ‘-F’ for an online config directory. As default, Ubuntu starts slapd with ‘-F /etc/ldap/slapd.d/’.

You can change this behaviour by changing the default start behaviour in the file /etc/default/slapd. Just add the statical configuration file at the config variable ‘SLAPD_CONF=’, on Karmic at the 6th line of the file.

SLAPD_CONF=/etc/ldap/slapd.conf

This switches back to the old-fashioned static config behaviour on Ubuntu Karmic (and hopefully this also works for other versions).