Bug 604092 - Init script is working wrong if database recovery is needed
Summary: Init script is working wrong if database recovery is needed
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: openldap
Version: 5.5
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Jan Vcelak
QA Contact: Ondrej Moriš
URL:
Whiteboard:
Depends On:
Blocks: 613966 667768
TreeView+ depends on / blocked
 
Reported: 2010-06-15 12:14 UTC by olaf
Modified: 2018-11-27 21:39 UTC (History)
6 users (show)

Fixed In Version: openldap-2.3.43-20.el5
Doc Type: Bug Fix
Doc Text:
- openldap-servers package is installed, the server was shutdown incorrectly and the database needs recovery - openldap intiscript will refuse to start the server - added option to the tool, which checks openldap server configuration, to skip database checks - the openldap server will start and the database is recovered automatically at the startup
Clone Of:
: 613966 667768 (view as bug list)
Environment:
Last Closed: 2012-02-21 05:26:23 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0155 0 normal SHIPPED_LIVE openldap bug fix and enhancement update 2012-02-20 14:54:48 UTC

Description olaf 2010-06-15 12:14:41 UTC
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 Zeleny 2010-07-13 11:43:15 UTC
Actually just calling slaptest with -u every time will do the trick. But this is a change of behavior which is not likely to be expected in RHEL-5. It is a good idea to fix it in RHEL-6 though.

Comment 3 RHEL Program Management 2010-08-09 18:22:52 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 4 RHEL Program Management 2011-01-11 20:31:13 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 5 RHEL Program Management 2011-01-11 23:16:20 UTC
This request was erroneously denied for the current release of
Red Hat Enterprise Linux.  The error has been fixed and this
request has been re-proposed for the current release.

Comment 6 RHEL Program Management 2011-05-31 13:23:59 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 9 Jan Vcelak 2011-08-18 17:57:13 UTC
Resolved in openldap-2.3.43-20.el5

Comment 11 Jan Vcelak 2011-08-26 13:47:16 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
- openldap-servers package is installed, the server was shutdown incorrectly and the database needs recovery
- openldap intiscript will refuse to start the server
- added option to the tool, which checks openldap server configuration, to skip database checks
- the openldap server will start and the database is recovered automatically at the startup

Comment 13 errata-xmlrpc 2012-02-21 05:26:23 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0155.html


Note You need to log in before you can comment on or make changes to this bug.