[Date Prev][Date Next] [Chronological] [Thread] [Top]

slapadd and a brand new database (ITS#1157)

Full_Name: Rafael Corvalan
Version: 2.0.7-14
OS: RedHat Linux 7.1
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (


I noticed that when I try to recreate a database from scratch (after deleting
the LDBM files), using slapadd, it doesn't work. But if the database has been
already initialized before, even if all entries have been removed, it works.

Here's what happens (I removed or added blank lines to keep it easy to read):

[lynx | root] ~ > ldapsearch -LLL -h localhost -s sub -b 'dc=company,dc=com' -x
dn: dc=company, dc=com
dn: cn=Directory Manager, dc=company, dc=com
dn: ou=Directory Administrators, dc=company, dc=com
dn: ou=People, dc=company, dc=com
dn: uid=pyc, ou=People, dc=company, dc=com
dn: uid=rco, ou=People, dc=company, dc=com

[lynx | root] ~ > /etc/rc.d/init.d/ldap stop
Stopping slapd:                                            [  OK  ]
[lynx | root] ~ > slapcat -b 'dc=company,dc=com' -l /tmp/company.com.ldif
[lynx | root] ~ > rm -r /var/lib/ldap/*
[lynx | root] ~ > slapadd -v -b 'dc=company,dc=com' -l /tmp/company.com.ldif
added: "ou=Directory Administrators, dc=company, dc=com" (00000001)
added: "cn=Directory Manager, dc=company, dc=com" (00000002)
added: "uid=rco, ou=People, dc=company, dc=com" (00000003)
added: "dc=company, dc=com" (00000004)
added: "uid=pyc, ou=People, dc=company, dc=com" (00000005)
added: "ou=People, dc=company, dc=com" (00000006)

[lynx | root] ~ > /etc/rc.d/init.d/ldap start
Starting slapd:                                            [  OK  ]

[lynx | root] ~ > ldapsearch -LLL -h localhost -s sub -b 'dc=company,dc=com' -x
No such object (32)

Now, I do the same thing, but before using slapadd, I insert the dcObject object
using ldapadd (not slapadd) and then I remove it (ldapdelete). Then it works.
It seems like the database files must be initialized before adding something
with slapadd. I tried several things and it doesn't work better:
1) Rebuilding the indexes (slapindex) after slapadd
2) Start ans stop the server before adding the data
and a lot of other tests...

Does the database files MUST exist prior to run slapadd? If so, why, after
adding the entries with slapadd, slapcat show all the entries and ldapsearch

Thanks and regards