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

Re: OpenLDAP Log files



On Wed, Feb 03, 2010 at 08:13:36AM -0600, sgmayo@mail.bloomfield.k12.mo.us wrote:

> One of my teachers decided to move things around and plugged a network
> cable in the wrong place causing a network loop and it seems to have ended
> up corrupting my ldap database.

That seems a bit unlikely to cause corruption on its own, but
if power also got replugged without shutting down properly
then it could well happen.

> Where are the log files from slapd at and/or how do I read them?

Do you mean human-readable logs of what has happenned, or
database redo/rollback logs?

You may not have any human-readable logs at all: it depends
on the setting of the 'loglevel' key in slapd.conf and on the
configuration of your syslog daemon.

> I did a 'slapd -d -1' and the pages just keep flying by and never stop
> without a ctrl-c.

Using -1 turns on every possible sort of debug output, which
is far too much for this job. I would suggest using '-d 768'
which is enough to put the server into debug mode and show
you the main parameters of each operation. That may give you
a clue about what is happenning.

Note that Fedora probably adds other parameters when it
starts slapd, and some of them are probably essential so you
must include them when you test it.

>  I have run a slapd_db_recover on this Fedora 10 box,
> but that did not seem to fix the problem I guess.

You have not said exactly what the problem is and what the
symptoms are: that would help.

> I did slapcat the directory to an ldif file yesterday, but I am wondering
> if it did not already contain some bad data.  I may see if I can slapadd
> it back in if ldap does not have to be running.  If it does then I will
> have to do something else.

Slapadd should be run with slapd stopped.

I would suggest that you do NOT re-add the data on top of the
existing database. For safer testing, do something like this:

1)	Make sure that slapd is stopped

2)	Find the database directory and move it aside.
	This preserves the old data.

3)	Create a new database directory and make sure that
	the permissions and ownership match the original.

4)	If there was a DB_CONFIG file in the original
	database directory, then copy it to the new one.

5)	Use slapadd to load in the data that you had saved in
	the LDIF file.
	If slapd was started with parameters giving a
	non-default database loaction etc then you will need
	to provide those same parameters to slapadd.

6)	Start slapd.
	If it still does not start, try with '-d 768' and
	look at the output.

Andrew
-- 
-----------------------------------------------------------------------
|                 From Andrew Findlay, Skills 1st Ltd                 |
| Consultant in large-scale systems, networks, and directory services |
|     http://www.skills-1st.co.uk/                +44 1628 782565     |
-----------------------------------------------------------------------