ClearOS LDAP Failed To Start


There are a few steps you can take to recover from a corrupt LDAP database. These have been scattered around the forums a bit – but can be summarised below

Backup your existing LDAP database:-
(do this routinely!, it is done as part of the ClearCenter Remote Server Backup configuration, so recommend using this service if you don’t, unfortunately it’s no longer free)

Code:

tar -cvzf ldapbackup-`date +%F`.tar.gz /var/lib/ldap/*
slapcat -n 3 -l /var/tmp/LDAPdata.ldif
slapcat -n 2 -l /var/tmp/accesslog.ldif

For mild corruption:-

Code:

service ldap stop
slapd_db_recover -v -h /var/lib/ldap
slapd_db_recover -v -h /var/lib/ldap/accesslog
service ldap start

For more severe corruption:-

Code:

service ldap stop
slapd_db_recover -h /var/lib/ldap -v -c
slapd_db_recover -h /var/lib/ldap/accesslog -c -v

For extreme problems, wipe it and start again – NOTE WILL WIPE ALL USERS, GROUPS, ACCOUNTS etc!

Code:

service ldap stop
ldapsetup -f
#Answer several questions, and give a long complex password without spaces. Then reimport your old users
slapadd -n 3 -l /var/tmp/LDAPdata.ldif
slapadd -n 2 -l /var/tmp/accesslog.ldif
service ldap start

Alternatively instead of reimporting your ldiff backup files, you can go to the webconfig and recreate all your users


Leave a Reply