OpenLDAP database has vanished

Dominic Mitchell dom at happygiraffe.net
Wed Apr 3 15:58:43 BST 2002


On Wed, Apr 03, 2002 at 11:29:08AM +0100, Tim Wiser wrote:
> Hi,
> 
> I'm a newcomer to FreeBSD so please be gentle with me!  I've got a BSD
> server up and running with a view to moving our company email onto it (it's
> currently living on an Exchange box).  As such, I've installed it with
> sendmail, qpopper and openldap to provide directory services.  All was
> running fine until this morning when I discovered that the LDAP service was
> no longer working.  Initially I thought that the daemon wasn't running as
> the server was restarted last week during some diagnostic work.  This was
> indeed the case, and I restarted the daemon. However, it now refuses to hand
> out any info in response to queries.
> 
> I am using the following webpage for guidance on getting LDAP running, as
> it's the guide I originally followed and found most useful when getting it
> working first time round: http://www.aplawrence.com/Unixart/ldap.html

You may also want to take a look at the OpenLDAP administrators guide on
www.openldap.org.  It's slightly terse, but does have the essentials.

Alas, LDAP is generally quite under documented.  :-(

> I've created an LDIF file containing all the LDAP info for the company, and
> if I do an ldapadd, it accepts the data quite happily.  I'm still not able
> to successfully query the database though:
> 
> mail# ldapsearch -L -b "o=Pennine, c=UK" "(cn=Tim)"
> mail#
> 
> ... even though there should be (and certainly USED to be) an entry in the
> database file that I fed ldif2ldbm for that user (ie: myself).
> 
> Basically, it seems that slapd has either forgotten or lost the LDAP
> database.

I would try installing the "gq" port (cd /usr/ports/net/gq && make
install).  It gives a very nice interface to browsing ldap servers,
although it does require X.

> One other thing is that if I go into the /usr/local/libexec folder and run
> the slapd file, it gives:
> 
> mail# cd /usr/local/libexec
> mail# ls -la
> total 799
> drwxr-xr-x   3 root  wheel     512 Mar 27 12:19 .
> drwxr-xr-x  13 root  wheel     512 Mar 27 12:19 ..
> drwxr-xr-x   2 root  wheel    1024 Mar 27 12:20 apache
> -rwxr-xr-x   1 root  wheel    9932 Mar 14 12:58 fax500
> -r-xr-xr-x   1 root  wheel   83824 Sep 14  2001 fetchmailconf.bin
> -rwxr-xr-x   1 root  wheel   13284 Mar 14 12:58 go500
> -rwxr-xr-x   1 root  wheel   16836 Mar 14 12:58 go500gw
> -rwxr-xr-x   1 root  wheel   10612 Mar 14 12:58 in.xfingerd
> -r-xr-xr-x   1 bin   bin     85986 Mar 14 12:50 mail.local
> -rwxr-xr-x   1 root  wheel   20776 Mar 14 12:58 mail500
> -rwxr-xr-x   1 root  wheel  114196 Sep 13  2001 maildap
> -r-xr-xr-x   1 root  wheel  124956 Mar 13 09:03 qpopper
> -rwxr-xr-x   1 root  wheel   13264 Mar 14 12:58 rcpt500
> -rwxr-xr-x   1 root  wheel    9932 Mar 14 12:58 rp500
> -rwxr-xr-x   1 root  wheel  170880 Mar 14 12:58 slapd
> -rwxr-xr-x   1 root  wheel   45268 Mar 14 12:58 slurpd
> -r-xr-xr-x   1 bin   bin     56431 Mar 14 12:50 smrsh
> -rwxr-xr-x   1 root  wheel    1694 Mar 14 12:57 xrpcomp
> mail# slapd
> slapd: Command not found.
> mail#

This is down to the fact that Unix does not search the current directory
when it's looking for programs to run.  This is a feature!  Instead, you
can do "./slapd" or "/usr/local/libexec/slapd".  However, there should
be a proper startup script in /usr/local/etc/rc.d/slapd.sh, so you
should start it using that:

    # /usr/local/etc/rc.d/slapd.sh start

Although, by default, the port probably only installs a sample file.
Try doing this:

    # cd /usr/local/etc/rc.d
    # mv slapd.sh.sample slapd.sh
    # /usr/local/etc/rc.d/slapd.sh start

This means that the LDAP server will start automatically on boot.

-Dom




More information about the Ukfreebsd mailing list