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

Re: problem importing cn=config



Greg Martin wrote:
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.

Yes, that's pretty much correct. You converted your *slapd configuration* from the old slapd.conf format to the new slapd.d format. In either the old or the new format, slapd just reads what you have, there's no extra "load" step needed.


Converting to an intermediate format (plain LDIF) that then requires manual loading would just be a waste of time, and one thing I utterly detest is software that wastes my time.

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:
SLAPD.CONF CONVERSION
    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.

You're still not seeing it. We don't "construct the config.ldif." We only convert the old config file format to the new config directory format. *You* might write a "config.ldif" file by hand, if you're bootstrapping a configuration from scratch, but that's entirely different. There is no "config.ldif" unless you created that yourself, and that has nothing to do with slapd's config directory.


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

-- -- Howard Chu Chief Architect, Symas Corp. http://www.symas.com Director, Highland Sun http://highlandsun.com/hyc/ Chief Architect, OpenLDAP http://www.openldap.org/project/