With a little side of applesauce...

Tuesday, December 9, 2008

I had an issue where the slapd init scripts were not starting slapd on Ubuntu 8.10 (andLinux). The only errors that I was getting were in syslog:

Dec  9 17:55:10 andLinux slapd[3212]: @(#) $OpenLDAP: slapd 2.4.11 (Nov  8 2008 09:42:18) $ ^Ibuildd@palmer:/build/buildd/openldap-2.4.11/debian/build/servers/slapd
Dec 9 17:55:10 andLinux slapd[3213]: bdb_db_open: database "dc=domain,dc=com" cannot be opened, err 13. Restore from backup!
Dec 9 17:55:10 andLinux slapd[3213]: bdb(dc=domain,dc=com): txn_checkpoint interface requires an environment configured for the transaction subsystem
Dec 9 17:55:10 andLinux slapd[3213]: bdb_db_close: database "dc=domain,dc=com": txn_checkpoint failed: Invalid argument (22).
Dec 9 17:55:10 andLinux slapd[3213]: backend_startup_one: bi_db_open failed! (13)
Dec 9 17:55:10 andLinux slapd[3213]: bdb_db_close: database "dc=domain,dc=com": alock_close failed
Dec 9 17:55:10 andLinux slapd[3213]: slapd stopped.


All errors pointed to a corrupt database, but I _was_ able to start slapd as root, so I checked permissions on the files /var/lib/ldap/:

Dec  9 17:55:10 andLinux slapd[3212]: @(#) $OpenLDAP: slapd 2.4.11 (Nov  8 2008 09:42:18) $ ^Ibuildd@palmer:/build/buildd/openldap-2.4.11/debian/build/servers/slapd
Dec 9 17:55:10 andLinux slapd[3213]: bdb_db_open: database "dc=domain,dc=com" cannot be opened, err 13. Restore from backup!
-rw-r----- 1 openldap openldap 96 Dec 3 15:24 DB_CONFIG
-rw------- 1 root root 24576 Dec 5 10:19 __db.005
-rw------- 1 root root 565248 Dec 5 10:19 __db.004
-rw------- 1 root root 98304 Dec 5 10:19 __db.003
-rw------- 1 root root 2629632 Dec 5 10:19 __db.002
-rw------- 1 root root 8192 Dec 5 10:19 __db.001
-rw-r----- 1 openldap openldap 28672 Dec 9 18:09 objectClass.bdb
-rw-r----- 1 openldap openldap 3408231 Dec 9 18:09 log.0000000001
-rw-r----- 1 openldap openldap 622592 Dec 9 18:09 id2entry.bdb
-rw-r----- 1 openldap openldap 352256 Dec 9 18:09 dn2id.bdb
-rw-r----- 1 openldap openldap 4096 Dec 9 18:09 alock


Ahhh! My sudo slapd -d -1 had kicked me in the bootie... I chown'd all of the files back to openldap.openldap, and sudo /etc/init.d/slapd start(ed) the daemon fine.

No comments: