[Pkg-openldap-devel] r663 - openldap/trunk-2.3/debian

Matthijs Mohlmann active2-guest at costa.debian.org
Tue May 30 16:48:16 UTC 2006


Author: active2-guest
Date: 2006-05-30 16:48:15 +0000 (Tue, 30 May 2006)
New Revision: 663

Modified:
   openldap/trunk-2.3/debian/changelog
   openldap/trunk-2.3/debian/slapd.default
   openldap/trunk-2.3/debian/slapd.init
Log:
 * Removed db_recover functions from init.d script, this was introduced in an
   earlier version, but is not needed anymore.


Modified: openldap/trunk-2.3/debian/changelog
===================================================================
--- openldap/trunk-2.3/debian/changelog	2006-05-30 16:11:41 UTC (rev 662)
+++ openldap/trunk-2.3/debian/changelog	2006-05-30 16:48:15 UTC (rev 663)
@@ -6,12 +6,15 @@
   * Removed patch configure.in-fix, incorporated upstream.
   * Move debian/configure.options.new to debian/configure.options.
   * Added patch to put ldapi socket in /var/run/slapd.
+  * Removed bdb recovery from the init.d script. This was introduced to fix
+    bug #255276. Now that slapd has the ability to check and recover from bdb
+    failures, this function is not needed anymore. (Closes: #369484, #369093)
 
   [ Torsten Landschoff ]
   * Include man pages for accesslog and auditlog overlays, patch by
     Peter Marschall (closes: #368888).
 
- -- Matthijs Mohlmann <matthijs at cacholong.nl>  Thu, 25 May 2006 22:56:55 +0200
+ -- Matthijs Mohlmann <matthijs at cacholong.nl>  Tue, 30 May 2006 18:37:51 +0200
 
 openldap2.3 (2.3.23-1) unstable; urgency=low
 

Modified: openldap/trunk-2.3/debian/slapd.default
===================================================================
--- openldap/trunk-2.3/debian/slapd.default	2006-05-30 16:11:41 UTC (rev 662)
+++ openldap/trunk-2.3/debian/slapd.default	2006-05-30 16:48:15 UTC (rev 663)
@@ -13,9 +13,6 @@
 # will try to figure it out from $SLAPD_CONF (/etc/ldap/slapd.conf)
 SLAPD_PIDFILE=
 
-# Configure if db_recover should be called before starting slapd
-TRY_BDB_RECOVERY=yes
-
 # Configure if the slurpd daemon should be started. Possible values: 
 # - yes:   Always start slurpd
 # - no:    Never start slurpd

Modified: openldap/trunk-2.3/debian/slapd.init
===================================================================
--- openldap/trunk-2.3/debian/slapd.init	2006-05-30 16:11:41 UTC (rev 662)
+++ openldap/trunk-2.3/debian/slapd.init	2006-05-30 16:48:15 UTC (rev 663)
@@ -6,9 +6,6 @@
 # Stop processing if slapd is not there
 [ -x /usr/sbin/slapd ] || exit 0
 
-# Set default values
-DB_RECOVER_CMD=db4.2_recover
-
 # Source the init script configuration
 if [ -f "/etc/default/slapd" ]; then
 	. /etc/default/slapd
@@ -109,82 +106,6 @@
 	fi
 }
 
-# Try to recover slapd database
-try_fix_db() {
-	local dbdir failed bdb_envs
-
-	# db4.2-util is just recommended by slapd, so make sure it is
-	# available before trying to use it
-	if ! command -v $DB_RECOVER_CMD >/dev/null 2>&1; then
-		echo -n " ($DB_RECOVER_CMD not found), "
-		return 0
-	fi
-
-	bdb_envs=`find_bdb_envs`
-
-	# We care only about BDB environments
-	if [ -z "$bdb_envs" ]; then
-		return 0
-	fi
-
-	# Make sure there is no slapcat and no slapd running as we might
-	# break the DB in that case
-	if pidof /usr/lib/slapd >/dev/null; then
-		echo -n " (slapd running, no recovery), "
-		return 0
-	fi
-
-	echo -n " running BDB recovery"
-	for dbdir in $bdb_envs; do
-		do_db_recover $dbdir
-	done
-	echo -n ","
-}
-
-# Run db_recover for the BDB environment in given directory and set $reason
-# on error
-do_db_recover() {
-	local dbdir
-	dbdir="$1"
-	if [  "$SLAPD_USER" ]; then
-		reason=`su "$SLAPD_USER" -s /bin/sh -c \
-			"$DB_RECOVER_CMD -eh $dbdir" 2>&1` || \
-			db_recover_failed $dbdir
-	else
-		reason=`$DB_RECOVER_CMD -eh $dbdir 2>&1` || \
-			db_recover_failed $dbdir
-	fi
-}
-
-# Find bdb environment dirs
-find_bdb_envs() {
-	local d
-	for d in `sed -ne 's/^directory[[:space:]]\+"*\([^"]\+\).*/\1/p' \
-			< "$SLAPD_CONF"`; do
-		if [ -d "$d" -a -f "$d/objectClass.bdb" ]; then
-			echo $d
-		fi
-	done
-}
-
-# Inform the user that BDB recovery failed
-db_recover_failed() {
-	local dbdir
-	dbdir="$1"
-
-	reason="`cat <<EOF
-Automatic recovery of the OpenLDAP directory database in
-
-	$dbdir
-
-failed. You will need to perform a manual recovery, possibly from backup.
-The failed command was $DB_RECOVER_CMD -eh $dbdir. Output:
-
-$reason
-EOF`"
-	exit 1
-}
-
 # Start the slapd daemon and capture the error message if any to 
 # $reason.
 start_slapd() {
@@ -235,9 +156,6 @@
 start() {
 	echo -n "Starting OpenLDAP:"
 	trap 'report_failure' 0
-	if [ "$TRY_BDB_RECOVERY" = "yes" ]; then
-		try_fix_db
-	fi
 	start_slapd
 	start_slurpd
 	trap "-" 0




More information about the Pkg-openldap-devel mailing list