Problem: Check database: ...WARNING. There are 19 stale locks in LDAP backend Berkeley DB

Problem:

Check database: ...WARNING.
WARNING: There are 19 stale locks in LDAP backend Berkeley DB (version 5.1.29).
WARNING: If slapd does not respond, manual LDAP dump/restore may be necessary.
Continuing BDB database check: ...done.
Starting ldap server(s): slapd ...done.
Checking Schema ID: ...done.

Solution

To dump and restore the database, you can do the folllowing:

/etc/init.d/slapd stop
slapcat >ldif 
mkdir /var/lib/univention-ldap/ldap.BACKUP
mv /var/lib/univention-ldap/ldap/* /var/lib/univention-ldap/ldap.BACKUP
ucr commit /var/lib/univention-ldap/ldap/DB_CONFIG 
slapadd <ldif or slapadd -l ldif

Note: If you still use BDB the ucr commit /var/lib/univention-ldap/ldap/DB_CONFIG command is absolutely necessary. With MDB it is not.

Mastodon