Bug 528124 - openldap slapd init script does not wait for database shutdown
Summary: openldap slapd init script does not wait for database shutdown
Keywords:
Status: CLOSED DUPLICATE of bug 452064
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: openldap
Version: 5.4
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
: ---
Assignee: Jan Zeleny
QA Contact: qe-baseos-daemons
URL: http://www.openldap.org/lists/openlda...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-10-09 09:20 UTC by Ingvar Hagelund
Modified: 2009-10-20 08:58 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-10-19 09:01:01 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
patch for ldap init script fixing missing -d option to killproc (654 bytes, patch)
2009-10-09 09:20 UTC, Ingvar Hagelund
no flags Details | Diff

Description Ingvar Hagelund 2009-10-09 09:20:17 UTC
Created attachment 364226 [details]
patch for ldap init script fixing missing -d option to killproc

Description of problem:
When running "service ldap stop", the init script calls killproc without the -d option, thus killproc does not wait more than the minimum time before killing the process. With a large ldap catalog, this is not enough, and db corruption may occur.

Version-Release number of selected component (if applicable):
openldap-servers-2.3.43-3.el5, and all earlier versions.

How reproducible:
Often with large datasets

Steps to Reproduce:
See the mail thread at
http://www.openldap.org/lists/openldap-software/200910/msg00012.html
  
Actual results:
init script does not wait long enough for slapd shutdown. ldap db corruption may occur.

Expected results:
The init script should have a configurable timeout from sysconfig like the fedora init script has had since 2.4.11-3, and wait the configured time before killing slapd.

Additional info:
Fixing this is trivial. See attached diff.

Btw, adding support for killproc's -p (pidfile) option would also a good thing, as this makes the system less prone to kill wrong processes. (But remember that killproc's -p option is not supported in rhel4 and earlier).

Comment 1 Jan Zeleny 2009-10-19 09:01:01 UTC
After some walk through bugzilla, I found another bug describing this solution, closing this one as duplicate.

*** This bug has been marked as a duplicate of bug 452064 ***

Comment 2 Matteo Scaramuccia 2009-10-20 07:53:43 UTC
Please keep me updated about the resolution through this bug, if possible, since I cannot access to the source for this duplication, #452064 (Access Denied. You are not authorized to access bug #452064.). TIA.

Comment 3 Jan Zeleny 2009-10-20 08:58:36 UTC
I'm hoping to get the bug approved for fix in RHEL 5.5. If it happens, updates will be available through RHN.

For now, this is basically the patch I will be applying:
--- ldap_real_orig/ldap.init    2008-04-03 08:43:46.000000000 +0100
+++ ldap/ldap.init      2008-04-03 08:37:30.000000000 +0100
@@ -180,7 +180,7 @@ function stop() {
        # Stop daemons.
        prog=`basename ${slapd}`
        echo -n $"Stopping $prog: "
-       killproc ${slapd}
+       killproc -d $STOP_DELAY ${slapd}
        RETVAL=$?
        echo
        if [ $RETVAL -eq 0 ]; then


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