[CentOS] openldap 2.4.11 ......unable to start on reboot

Tue Mar 3 17:47:26 UTC 2009
Bill Campbell <centos at celestial.com>

On Tue, Mar 03, 2009, Agnello George wrote:
>I had upgraed my opneldap rpm frm 2.3.27 to 2.4.11 with ehelp of the
>followng link http://staff.osuosl.org/~jeff/openldap/
>I had then rebooted my machine and now whne i am starting ldap
>[root at system-test40 ldap]# /etc/init.d/ldap start
>Checking configuration files for slapd:  bdb_db_open: database
>"o=netserv_ldap": unclean shutdown detected; attempting recovery.
>bdb_db_open: database "o=netserv_ldap": recovery skipped in read-only
>mode. Run manual recovery if errors are encountered.
>ch_calloc of 1 elems of 480000004 bytes failed
>slaptest: ../../../servers/slapd/ch_malloc.c:107: ch_calloc: Assertion
>`0' failed.
>i tried to do some recovery as mentioned in vairous archives :
>cd /var/lib/ldap
>slapd_db_recover -v

I think this should be ``slapd_db_recover -h $PWD''

The fact that it's saying that it is skipping read-only either means that
the /ver/lib/ldap directory is on a read-only file system, or perhaps
slapd_db_recover requires the ``-h'' option to really do it's work.

I think that slapd_db_recover is a version of the Sleepycat Berkeley
database (bdb) db_recover routine, specific to the version of bdb on which
openldap-server is built.  The bdb is some of the worst looking spaghetti
code I have seen in over 40 years of programming work (look at the #if
statements in the perl or python bdb routines to get an idea of how ugly it
is with dependencies on both major and minor releases).

As a last resort, ``rm /var/lib/ldap/*'' will clear all the openldap data
files allowing it to restart so you can rebuild its data from scratch.

INTERNET:   bill at celestial.com  Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/  PO Box 820; 6641 E. Mercer Way
Voice:          (206) 236-1676  Mercer Island, WA 98040-0820
Fax:            (206) 232-9186

Force always attracts men of low morality.  -- Albert Einstein