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

Re: slapcat -n 0 and slapadd

Craig White wrote:
On Oct 26, 2011, at 1:13 PM, Howard Chu wrote:
Pay attention. Even a monkey can copy text without omitting parts.

slapadd -F /etc/ldap/slapd.d -n 0 -l slapcat_config.ldif
sorry - I'm stupid but and am not a monkey.

It seems to me the reason that something like Zytrax gets traction is
sometimes the seemingly very simple just doesn't work and then of course,
there is the public chastisement that seemingly comes with the territory.

It's called negative reinforcement, and it is intentional, to discourage careless posts like yours. You're free to carelessly waste as much of your own time as you like, but it's extremely inconsiderate of you to waste the time of everyone else subscribed to the mailing list.

I am trying to do is have a disaster plan though admittedly, I can do pretty
much the same because I have a scripted installation which I can use to set up
the configuration again and just ldapadd (possibly slapadd) the main DSA data.
This was something I could do easily with a flat file configuration but
dynamic configuration has made this a real chore.

It may seem a "real chore" to you but you've only made it difficult for yourself, by failing to read and pay attention, as already demonstrated before. There are countless installations out there all working fine. The majority of deployments simply fire it up and go their merry way. That would not be the case, if things were as difficult as you make them out to be.

blow by blow... (have done slapcat -n 0& -n 1 from my production machine
am working on a VM test, certificate names& paths have been fixed for the VM
and adjustments made for apparmor)

root@ubuntu:/etc/ldap# rm -fr slapd.d/*
root@ubuntu:/etc/ldap# rm -fr /var/lib/ldap/*
root@ubuntu:/etc/ldap# slapadd -F /etc/ldap/slapd.d -n 0 -l slapcat_config.ldif
olcDbDirectory: value #0: invalid path: No such file or directory
slapadd: could not add entry dn="olcDatabase={2}hdb,cn=config" (line=1009):
_###################   99.24% eta   none elapsed            none spd   5.4 M/s
Closing DB...

Your first mistake here is in continuing on even though this first slapadd command clearly failed. Again - PAY ATTENTION to what's in front of you.

Your other mistake is obviously that you deleted the directory that your config used. This mistake has nothing to do with dynamic configuration; you would have had the same error if you were using slapd.conf. It's easy to shirk responsibility for your actions and blame the software, but it's clear that you're creating your own problems by not paying attention to what you're doing.

root@ubuntu:/etc/ldap# slapadd -F /etc/ldap/slapd.d -n 1 -l slapcat_data.ldif
accesslog: "logdb<suffix>" missing or invalid.
backend_startup_one (type=hdb, suffix="dc=ttinet,dc=local"): bi_db_open failed! (1)
slap_startup failed

line 1009 in my slapcat_config.ldif...
dn: olcDatabase={2}hdb,cn=config

Once again - the software clearly told you which entry and attribute it had a problem with. If you had paid attention to it, instead of ignoring it and creating your own fantasy scenarios, you would have a working system by now.

but just above that line is the section...

Which was completely irrerlevant...

You can learn from your mistakes, and actually start paying attention, or you can continue to ignore what's in front of you. If you choose the latter, I would ask that you quit using OpenLDAP software and go use someone else's package, because there's nothing rewarding in trying to help people who don't learn.

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