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

Re: problem importing cn=config

Howard Chu wrote:
Greg Martin wrote:

1) to
convert slapd.conf to ./slapd.d, and the second to "initialize" it.
Since slapadd is used to add things to the database, I figured it was
being imported into the database.  Is the slappadd not necessary?

If you have a plain LDIF file produced by slapcat'ing a database, you can slapadd it to use it.

A slapd.d directory tree produced by converting a slapd.conf file is not a flat LDIF file, it's a tree of related files. It is in fact an LDAP database that uses a hierarchical filesystem as its underlying data store. Since it is an actual LDAP database, slapd reads it directly.
OK, I think I get that. Can you help me understand what the manpage is trying to tell me to do with this:

"Assuming the above data was saved in a  file  named  "config.ldif"
and  the /etc/openldap/slapd.d   directory   has  been  created,  this
command  will initialize the configuration:
             slapadd -F /etc/openldap/slapd.d -n 0 -l config.ldif"

After I ran slaptest to convert my slapd.conf to ./slapd.d, these instructions indicate to me there is more to do. What am I missing?

No, wait. Now I see. If I build the config.ldif from scratch, then I would run slapadd to construct the LDAP database. But since I used slaptest to convert my existing slapd, that construction was done as part of the conversion.

Perhaps the man page could be clarified a bit. The explanation of the conversion process is part of the EXAMPLES section. Maybe a SLAPD.CONF CONVERSION section could be added that says something like:
Conversion from slapd.conf to the slapd.d config directory can be accomplished using slaptest or any of the slap tools:
slaptest -f /etc/openldap/slapd.conf -F ETCDIR/slapd.d
This command will construct the config.ldif and construct the LDAP configuration database. Once completed, change the slapd startup command to reference the directory by using the -F ETCDIR/slapd.d in lieu of -f ETCDIR/slapd.d