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

Re: how to add a new database with slapd.d?

On 2010年07月26日 19:53, Jonathan Clarke wrote:

The file should be named /etc/ldap/slapd.d/cn=config/olcDatabase={1}hdb.ldif.

You are right. slapd behavior changed immediately after I renamed as you recommended.

I recommend using loglevel config to see debugging information related to configuration issues. If your file is not read, the hdb database won't appear in the output...

Thanks for recommendation. I tried it and began to have a second different problem. This time new db definition is obviously read, but slapd quit with error:
<= root access granted
=> access_allowed: search access granted by manage(=mwrscxd)
<= test_filter 6
: config_add_internal: DN="olcDatabase={1}bdb,cn=config" no structural objectClass (unrecognized objectClass 'olcBdbConfig')
config error processing olcDatabase={1}bdb,cn=config: 
send_ldap_result: conn=-1 op=0 p=0

This part "Unrecognized objectClass 'olcBdbConfig'" surprised me a bit, as the line caused the problem is taken from openldap manual:

Quote from http://www.openldap.org/doc/admin24/slapdconf2.html

5.2.6. BDB and HDB Database Directives

In addition to the olcDatabaseConfig objectClass, BDB and HDB database entries must have the olcBdbConfig and olcHdbConfig objectClass, respectively.

Jonathan Clarke also wrote:
One would usually add the new configuration object via LDAP, rather than by modifying the database files. This is the point of cn=config. However, adding files may work also...


Perhaps I missed some document, but what you said is not mentioned in the document I referred to. I think it make a lot of sense to add new database via LDAP, but a newbie would not be able to assume this can be done, especially puzzled by not knowing what crediential should I use to access db cn=config, because olcRootPW is not existing in any of the ldif files except the one I just added:

# grep -R olcRootPW /etc/ldap/slapd.d/
\/etc/ldap/slapd.d/cn=config/olcDatabase=bdb:olcRootPW: secret
/etc/ldap/slapd.d/cn=config/olcDatabase={1}hdb:olcRootPW: secret