I have a openldap replica running syncrep that became corrupted irrecoverably yesterday. Since it is running syncrep I just deleted the database files and restarted it.
Now I can run openldap with this command
Code:
slapd -u ldap -f /etc/openldap/slapd.conf
but not with
Code:
# service ldap start
Checking configuration files for slapd: bdb_db_open: alock package is unstable
backend_startup_one: bi_db_open failed! (-1)
slap_startup failed (test would succeed using the -u switch)
[FAILED]
stale lock files may be present in /var/lib/ldap [WARNING]
I have removed the alock file from /var/lib/ldap and then run slapd_db_recover but I still get the same result.
I have seen this error be caused by file permissions but I cannot find a permission problem this time.
I found this in the init script that makes me wonder if the __db.001 should not exist?
Code:
# Check the configuration file.
if ! action $"Checking configuration files for $prog: " /sbin/runuser -m -s "$slaptest" -- "$user" $slaptestflags; then
if /sbin/runuser -m -s "$slaptest" -- "$user" "-u" > /dev/null 2> /dev/null ; then
dirs=`LANG=C egrep '^directory[[:space:]]+[[:print:]]+$' /etc/openldap/slapd.conf | awk '{print $2}'`
for directory in $dirs ; do
if test -r $directory/__db.001 ; then
echo -n $"stale lock files may be present in $directory" ; warning ; echo
fi
done
fi
exit 1
fi
Permissions in /var/lib/ldap
Code:
# ll /var/lib/ldap
total 158856
-rw-r--r-- 1 ldap ldap 2048 May 9 22:43 alock
-rw------- 1 ldap ldap 356352 May 9 17:18 cn.bdb
-rw------- 1 ldap ldap 24576 May 9 22:43 __db.001
-rw------- 1 ldap ldap 159842304 May 10 10:58 __db.002
-rw------- 1 ldap ldap 536870912 May 10 10:58 __db.003
-rw------- 1 ldap ldap 2359296 May 10 10:55 __db.004
-rw------- 1 ldap ldap 352256 May 10 10:58 __db.005
-rw------- 1 ldap ldap 24576 May 10 10:55 __db.006
-rw-r----- 1 ldap ldap 920 May 9 16:22 DB_CONFIG
-rw------- 1 ldap ldap 249856 May 9 15:42 dn2id.bdb
-rw------- 1 ldap ldap 40960 May 9 17:09 entryUUID.bdb
-rw------- 1 ldap ldap 36864 May 9 17:09 gidNumber.bdb
-rw------- 1 ldap ldap 114688 May 9 17:09 givenName.bdb
-rw------- 1 ldap ldap 1277952 May 9 17:55 id2entry.bdb
-rw------- 1 ldap ldap 10485760 May 9 15:42 log.0000000001
-rw------- 1 ldap ldap 10485760 May 10 10:55 log.0000000002
-rw------- 1 ldap ldap 28672 May 9 17:18 loginShell.bdb
-rw------- 1 ldap ldap 208896 May 9 17:09 mail.bdb
-rw------- 1 ldap ldap 253952 May 9 15:42 memberUid.bdb
-rw------- 1 ldap ldap 8192 May 9 15:42 nisMapEntry.bdb
-rw------- 1 ldap ldap 8192 May 9 15:42 nisMapName.bdb
-rw------- 1 ldap ldap 114688 May 9 17:09 objectClass.bdb
-rw------- 1 ldap ldap 8192 May 9 15:42 ou.bdb
-rw------- 1 ldap ldap 200704 May 9 17:55 sn.bdb
-rw------- 1 ldap ldap 237568 May 9 17:09 uid.bdb
-rw------- 1 ldap ldap 36864 May 9 17:09 uidNumber.bdb
RHEL 5.6
openldap-servers-2.3.43-12.el5_5.2
openldap-2.3.43-12.el5_5.2
openldap-clients-2.3.43-12.el5_5.2
openldap-servers-overlays-2.3.43-12.el5_5.2
openldap-devel-2.3.43-12.el5_5.2