I've also hit this on upgrade. It seems like the situation might be slightly complex.
My ldap config does not use the slapd.conf method, but cn=config.
/etc/ldap/ldap.conf contains:
BASE dc=company, dc=com
URL ldap://localhost/
Running dpkg --configure gives:
sudo dpkg --configure slapd
Setting up slapd (2.4.15-1ubuntu3) ...
Backing up /etc/ldap/slapd.d/ in /var/backups/slapd-2.4.11-0ubuntu6.1... done.
Moving old database directories to /var/backups:
Loading from /var/backups/slapd-2.4.11-0ubuntu6.1:
- directory dc=company,dc=com... failed.
Loading the database from the LDIF dump failed with the following
error while running slapadd:
slapadd: line 1: database (dc=company,dc=com) not configured to hold "dc=nodomain"
slapadd: line 1: database (dc=company,dc=com) not configured to hold "dc=nodomain"
dpkg: error processing slapd (--configure):
subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
slapd
The contents of the /var/backups/slapd-2.4.11-0ubuntu6.1 directory:
I've also hit this on upgrade. It seems like the situation might be slightly complex.
My ldap config does not use the slapd.conf method, but cn=config.
/etc/ldap/ldap.conf contains:
BASE dc=company, dc=com
URL ldap://localhost/
Running dpkg --configure gives:
sudo dpkg --configure slapd slapd-2. 4.11-0ubuntu6. 1... done. slapd-2. 4.11-0ubuntu6. 1: dc=com. .. failed.
Setting up slapd (2.4.15-1ubuntu3) ...
Backing up /etc/ldap/slapd.d/ in /var/backups/
Moving old database directories to /var/backups:
Loading from /var/backups/
- directory dc=company,
Loading the database from the LDIF dump failed with the following
error while running slapadd:
slapadd: line 1: database (dc=company,dc=com) not configured to hold "dc=nodomain"
slapadd: line 1: database (dc=company,dc=com) not configured to hold "dc=nodomain"
dpkg: error processing slapd (--configure):
subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
slapd
The contents of the /var/backups/ slapd-2. 4.11-0ubuntu6. 1 directory:
100 -rw-r--r-- 1 root root 94218 2009-05-22 14:10 dc=company, dc=com. ldif
4 drwxr-x--- 3 openldap openldap 4096 2009-05-22 15:13 slapd.d
Look at the .ldif mentioned there, it contains the following two entries:
dn: dc=nodomain bjectClass: organization 404b-102d- 96c3-01fea4f68a 30 tamp: 20081106124011Z 789553Z# 000000# 000#000000 tamp: 20081106124011Z
objectClass: top
objectClass: dcObject
objectClass: organization
o: nodomain
dc: nodomain
structuralO
entryUUID: cc19087c-
creatorsName:
createTimes
entryCSN: 20081106124011.
modifiersName:
modifyTimes
dn: cn=admin, dc=nodomain bject bjectClass: organizationalRole 404b-102d- 96c4-01fea4f68a 30 tamp: 20081106124011Z 794497Z# 000000# 000#000000 tamp: 20081106124011Z
objectClass: simpleSecurityO
objectClass: organizationalRole
cn: admin
description: LDAP administrator
userPassword:: <PASSWORDHASHHERE>
structuralO
entryUUID: cc19c4b0-
creatorsName:
createTimes
entryCSN: 20081106124011.
modifiersName:
modifyTimes
But _also_ sections like these with the correct dc=company,dc=com.
My wild guess is that /var/lib/ dpkg/info/ slapd.postinst is at fault, specifically
set_defaults_ for_unseen_ entries( ) with it's:
DOMAIN= `hostname -d 2>/dev/null` || true
if [ -z "$DOMAIN" ]; then DOMAIN='nodomain'; fi
Wouter van Heyst