Fixing OpenLDAP checksum errors in olc-config

Saturday, January 09, 2016 » OpenLDAP

Sometimes it is much easier to stop your slapd and edit the olc-config by hand, instead of using ldapmodify. But if you do that, your slapd will complain about the checksum of the edited ldif file.

ldif_read_file: checksum error on "/etc/ldap/slapd.d/cn=config/olcDatabase={1}mdb.ldif"

The checksum for the olc config ldif files are contained in the second line of those files. So you can just re-calculate the checksum for the config part (without the first two comment lines) of the file

1
tail -n +3 /etc/ldap/slapd.d/cn=config/olcDatabase\=\{1\}mdb.ldif | rhash -C - | awk '/stdin/ {print tolower($2)}'

and replace the checksum in the file.