Init script causing unclean DB shutdown
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
openldap2.3 (Ubuntu) |
Fix Released
|
Low
|
Unassigned |
Bug Description
slapd 2.3.30-2
To shutdown slapd the init script (/etc/init.d/slapd) calls start-stop-daemon with "--timeout 10". This effectively sends the slapd process a SIGTERM, waits 10 seconds and then sends a terminal SIGKILL, forcibly killing the process.
The problem is that under certain configurations (my configuration used back-hdb and a high checkpoint interval of 60 minutes), slapd takes longer than 10 seconds to cleanly shutdown. Terminating with SIGKILL while flushing the data to disk causes massive data corruption in the backend, in my case the next startup caused searches for specific DNs to return completely different entries as well as duplicating multiple entries across the same DN. Examples of the database corruption can be provided but I don't feel they are necessary for this bug report.
This can be worked around by using more frequent checkpoint intervals and/or faster disk hardware but it would obviously be better to provide a safer shutdown mechanism. I have provided the following patch which changes the behaviour of start-stop-daemon to send the SIGTERM, wait 10 seconds and then exit with a '2' errorlevel, although the default --quiet suppresses any error messages despite the scripts intentions.
--- openldap2.
+++ openldap2.
@@ -155,7 +155,7 @@
# $reason.
stop_slapd() {
echo -n " slapd"
- reason=
+ reason=
}
If I have omitted any detail please respond and I shall provide whatever is needed
Related branches
Changed in openldap2.3: | |
importance: | Undecided → Low |
status: | New → Triaged |
Changed in openldap2.3: | |
status: | Triaged → Fix Committed |
Attaching the patch as a file