After a crash, ldap startup will usually fail due to one or more of these issues: * Incorrect permissions on /var/lib/ldap/* (already partially detected on startup). * Corrupt database (usually fixed with db_recover). * Indexing issues (fixed with slapindex). I'm attaching a completely untested patch that should add a "clean" argument to ldap.init that will run db_recover and slapindex. I'd argue that this should happen during startup (possibly as a configurable thing). The patch should also catch when /var/lib/__db.* aren't owned by the ldap user.
Created attachment 132623 [details] ldap.init enhancements
openldap-servers-2.3.30-2.fc6 has improved startup checks and recovery. db_recover should be part of slapd initialization now.
I don't see anything about db_recover in the init script. Is this something slapd does internally?
Yes, slapd has ability to recover itself (at least with bdb backend). Of course, it will not recover from every possible error state, neither does db_recover.