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

Re: Can't start ldap or can't create ldap database.





--On Monday, June 21, 2010 08:52:44 PM +1000 sam <sam@ip6.com.au> wrote:

sam wrote:
Bill MacAllister wrote:


--On Monday, June 21, 2010 06:44:10 PM +1000 sam <sam@ip6.com.au> wrote:

Hi,

With the following configuration:

hometest:openldap # uname -a
FreeBSD hometest.ip6.com.au 8.1-RC1 FreeBSD 8.1-RC1 #0: Fri Jun 18
15:26:58 EST 2010
root@hometest.ip6.com.au:/usr/obj/usr/src/sys/mail.db.java.portal  i386
hometest:openldap # pkg_info | grep -i ldap
openldap-sasl-client-2.4.22 Open source LDAP client implementation
with SASL2 support
openldap-sasl-server-2.4.22 Open source LDAP server implementation
hometest:openldap # pkg_info | grep -i db
db46-4.6.21.4       The Berkeley DB package, revision 4.6
hometest:openldap # pkg_info | grep -i cyrus
cyrus-imapd-2.3.16_1 The cyrus mail server, supporting POP3 and
IMAP4 protocols
cyrus-sasl-2.1.23   RFC 2222 SASL (Simple Authentication and
Security Layer)
cyrus-sasl-saslauthd-2.1.23 SASL authentication server for cyrus-sasl2


I got the following error when I tried to add from initial.ldif file
into the ldap database:

hometest:openldap # ldapadd -x -D "cn=Manager,dc=ip6,dc=com,dc=au"
-W -f initial.ldif
Enter LDAP Password:
ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)

Here is the content of initial.ldif file:

hometest:openldap # cat initial.ldif
dn: dc=ip6,dc=com,dc=au
objectClass: top
objectClass: dcObject
objectClass: organization
o: IP6 Networks
dc: ip6

# super user node
dn: cn=root,dc=ip6,dc=com,dc=au
objectclass: organizationalRole
objectclass: simpleSecurityObject
cn: root
description: LDAP administrator
userPassword: {MD5}cW2LX0AjZxSBzv/mflD3xQ==

Can anyone tell me how resolve this issue?

Your help is very much appreciated.

Thanks
Sam


Sounds like the slapd server is not running at all.  And if you are
going to add entries with ldapadd the daemon needs to be running.  But,
since this is an initial load just added the entries with slapadd and
then start the server.

Bill


Hi Bill,

Thanks for your suggestion, I used the slapadd  command,

hometest:openldap # slapadd -v -l initial.ldif
bdb_db_open: warning - no DB_CONFIG file found in directory
/var/db/openldap-data: (2).
Expect poor performance for suffix "dc=ip6,dc=com,dc=au".
added: "dc=ip6,dc=com,dc=au" (00000001)
added: "cn=root,dc=ip6,dc=com,dc=au" (00000002)
_#################### 100.00% eta   none elapsed            none
fast!        Closing DB...

I am not sure whether this is the error or problem.

then tried to start slapd, I still got the same problem:

hometest:rc.d # ./slapd start
Starting slapd.
./slapd: WARNING: failed to start slapd


error in log file:

Jun 21 19:39:53 hometest slapd[1813]: @(#) $OpenLDAP: slapd 2.4.22
(Jan  1 2002 00:24:15) $
root@hometest.ip6.com.au:/usr/ports/net/openldap24-server/work/openldap-2.4.22/servers/slapd

Jun 21 19:39:53 hometest slapd[1813]: main: TLS init def ctx failed: -1
Jun 21 19:39:53 hometest slapd[1813]: slapd stopped.
Jun 21 19:39:53 hometest slapd[1813]: connections_destroy: nothing to
destroy.

Thanks
Sam


After I removed the TLS configuration in slapd.conf file, I managed to start slapd.

Jun 21 20:36:37 hometest slapd[2092]: @(#) $OpenLDAP: slapd 2.4.22 (Jan  1 2002 00:24:15) $     root@hometest.ip6.com.au:/usr/ports/net/openldap24-server/work/openldap-2.4.22/servers/slapd
Jun 21 20:36:38 hometest slapd[2093]: bdb_db_open: warning - no DB_CONFIG file found in directory /var/db/openldap-data: (2). Expect poor performance for suffix "dc=ip6,dc=com,dc=au".
Jun 21 20:36:38 hometest slapd[2093]: slapd starting

here, what is this DB_CONFIG file?

It is the bdb configuration file.  You can find information about it
in many places on the web.  Here is a document from the OpenLDAP site
that discusses it.

 http://www.openldap.org/faq/data/cache/1072.html

Unless you tune cache sizes and add some indexes OpenLDAP will be slow
for all but the smallest databases.

Bill


--

Bill MacAllister <whm@stanford.edu>
Systems Software Programmer, ITS Unix Systems, Stanford University