LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 07-11-2012, 09:17 AM   #1
Doknik
LQ Newbie
 
Registered: Jun 2010
Posts: 26

Rep: Reputation: 1
OpenLDAP fails to stop ,but seems to start Ok but then status shows as slapd stopped


Our LDAP server has been behaving erratically lately



1.It fails to stop when you issue command

service ldap restart

but it "seems" to starts OK

2.However after running command service ldap status (right after youve run the service ldap restart command)

it shows slapd is stopped. However bizarrely LDAP authentication works OK in this environment , despite this error.


We are running openldap 2.3.43 on RHel 5.3.

We have an LDAP main provider(server) which serves the various LDAP servers(replicas) in various other environments.

All the other LDAP replicas ,including the main provider are OK and not experiencing this problem (or showing this error) except for this one environment.


I have looked in the ldap.log file and the only errors worth mentioning are

Jun 25 22:11:14 myldapserver slapd[11593]: daemon IPv6 socket() errno=7

Jun25 22:11:15 myldapserver slapd[11598]: bdb(cn=accesslog):file id2entry.bdb (meta pgno =0) has LSN [1}[900784]

Jun25 22:11:15 myldapserver slapd[11598]: bdb(cn=accesslog):end of log is [1][956]
Jun25 22:11:15 myldapserver slapd[11598]: bdb(cn=accesslog):/var/log/ldap/accesslog/id2entry.bdb:unexpected file or format

Jun25 22:11:15 myldapserver slapd[11598]: bdb_db_opendb_open(cn=accesslog):/var/log/ldap/accesslog/id2entry.bdb) failed: Invalid argument (22)

Jun25 22:11:15 myldapserver slapd[11598]: bdb(cn=accesslog):Unknown locker ID :0


Jun25 22:11:15 myldapserver slapd[11598]:
Jun25 22:11:15 myldapserver slapd[11598]: backend_startup_one: bi_db_open failed! (22)
Jun25 22:11:15 myldapserver slapd[11598]: bd_db_close: alock close failed!
Jun 25 22:11:15 myldapserver slapd[11598]: slapd stopped.
Jun 25 22:11:15 myldapserver slapd[11598]: connections_destroy: nothing to destroy.


I have trawled through various forums but no useful help or solutions suggested
Your help would be greatly appreciated.
 
Old 07-12-2012, 04:06 AM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,956

Rep: Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341
Hi,

From the logs posted, looks like slapd is not starting because your database is corrupted.
If you have a backup, use it to restore the database. Or try with db_recover to fix the database.

Regards
 
Old 07-15-2012, 08:54 AM   #3
Doknik
LQ Newbie
 
Registered: Jun 2010
Posts: 26

Original Poster
Rep: Reputation: 1
Bathory,thanks a million for your help this is is what i suspected and i have googled a lot and tried a few commands to recover databases but no joy.
can you please give details as to how you want me to recover the database please i mean steps or commands i will try to google it too.Thanks
 
Old 07-15-2012, 11:03 AM   #4
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,956

Rep: Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341
Hi,

I guess you don't have a valid backup of the database. In this case you may try one of the following 2 ways to recover/restore the database

1.
The easiest way is to use db_recover to see if you can recover the corrupted database:
Go into /var/lib/ldap (or where openldap keeps its data) and run:
Code:
db_recover -v

2.
If this is a replica, you can use slapcat to take a backup from another replica (or the master) and use it to restore the corrupted database. E.g. run from a working replica:
Code:
slapcat -v -f /etc/openldap/slapd.conf -l backup.ldif
(change the path to slapd.conf accordingly, or use -F /etc/openldap/slapd.d if your slapd uses cn=config for configuration)

Then in the problematic server (re)move everything from /var/lib/ldap, except DB_CONFIG, transfer the backup ldif from the previous step and run:
Code:
slapadd -v -c -l /path/to/backup.ldif -f /etc/openldap/slapd.conf
Good luck!
 
  


Reply

Tags
openldap, rhel5


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
sshd service status shows "openssh-daemon is stopped" severus21 Red Hat 5 03-30-2012 04:54 AM
[SOLVED] Openldap does not start ./slapd does nothing chinho Linux - Software 3 01-05-2011 05:52 AM
ldap cannot carry slapd.conf changes or did not use /etc/openldap/slapd.conf joel_saul Linux - Server 6 08-21-2010 05:53 AM
LXer: OpenLDAP Quick Tips: Using syslog or syslog-ng with slapd for OpenLDAP logging LXer Syndicated Linux News 0 11-14-2008 09:41 PM
Printer fails to print: foomatic-rip stopped with status 1! robbyx Linux - Hardware 1 12-15-2006 04:38 AM


All times are GMT -5. The time now is 07:44 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration