Bug 667768

Summary: Init script is working wrong if database recovery is needed
Product: [Fedora] Fedora Reporter: Jan Vcelak <jvcelak>
Component: openldapAssignee: Jan Vcelak <jvcelak>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 14CC: jvcelak, rmeggins, tsmetana
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: openldap-2.4.23-10.fc14 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 604092 Environment:
Last Closed: 2011-09-25 03:47:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 604092    
Bug Blocks: 613966    

Description Jan Vcelak 2011-01-06 18:10:10 UTC
+++ This bug was initially created as a clone of Bug #604092 +++

Description of problem:
The problem is in init script (/etc/rc.d/init.d/ldap)

If recovery is required for bdb backend databases (because of unclean shutdown or other reason), the script prevents automatic recovery on start.

On start (in configtest procedure) it tries to execute "slaptest". If it fails, it won't continue.
If it fails because a bdb recovery is needed, then it is not possible to start slapd from initscipts. The automatic recovery is not performed because "slaptest" implies read-only mode.

The output looks like:

"[root@daisy ldap]# service ldap start
Checking configuration files for slapd:  bdb_db_open: unclean shutdown detected; attempting recovery.
bdb_db_open: Recovery skipped in read-only mode. Run manual recovery if errors are encountered."

When slapd is then run from command line then it performs automatic recovery and works fine. It is possible then to start slapd from initscripts.

It hit me really hard - the ldap has user and group database and the nss_ldap has very long timeouts, so to be able to get the machine working after crash I had to go in single user mode and fix it by hand.

Version-Release number of selected component (if applicable):
openldap-2.3.43-12.el5


How reproducible:
Always

Steps to Reproduce:
1. Corrupt the openldap bdb files in such fashion that recovery is required and automatic recovery will be able to handle this (it may be tricky :)
2. Try to start openldap: service ldap start
3.
  
Actual results:
The slapd doesn't start, as the initscript fails in earlier stage (at slaptest)

Expected results:
The slapd is started and performs automatic recovery. I think that the "configtest" part of this script should report errors but it shouldn't do an exit in case of failure. The script should try to start the slapd anyway.

Additional info:

Comment 1 Jan Vcelak 2011-01-06 18:12:32 UTC
Fedora is affected as well.

Easy way to reproduce: kill slapd when adding a lot of objects

Comment 2 Jan Vcelak 2011-01-06 20:54:35 UTC
Fixed in: openldap-2.4.23-5.fc14 openldap-2.4.23-5.fc15

Comment 3 Fedora Update System 2011-01-06 20:56:28 UTC
openldap-2.4.23-5.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/openldap-2.4.23-5.fc14

Comment 4 Fedora Update System 2011-01-07 20:00:08 UTC
openldap-2.4.23-5.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update openldap'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/openldap-2.4.23-5.fc14

Comment 5 Fedora Update System 2011-01-20 17:27:19 UTC
openldap-2.4.23-6.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/openldap-2.4.23-6.fc14

Comment 6 Fedora Update System 2011-01-25 13:35:23 UTC
openldap-2.4.23-7.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/openldap-2.4.23-7.fc14

Comment 7 Fedora Update System 2011-02-02 12:43:32 UTC
openldap-2.4.23-8.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/openldap-2.4.23-8.fc14

Comment 8 Fedora Update System 2011-03-01 12:42:15 UTC
Package openldap-2.4.21-12.fc13:
* should fix your issue,
* was pushed to the Fedora 13 updates-testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing openldap-2.4.21-12.fc13'
as soon as you are able to, then reboot.
Please go to the following url:
https://admin.fedoraproject.org/updates/openldap-2.4.21-12.fc13
then log in and leave karma (feedback).

Comment 9 Fedora Update System 2011-03-01 12:42:59 UTC
Package openldap-2.4.23-9.fc14:
* should fix your issue,
* was pushed to the Fedora 14 updates-testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing openldap-2.4.23-9.fc14'
as soon as you are able to, then reboot.
Please go to the following url:
https://admin.fedoraproject.org/updates/openldap-2.4.23-9.fc14
then log in and leave karma (feedback).

Comment 10 Fedora Update System 2011-03-19 00:21:07 UTC
openldap-2.4.23-10.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/openldap-2.4.23-10.fc14

Comment 11 Fedora Update System 2011-09-25 03:46:45 UTC
openldap-2.4.23-10.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.