[Pkg-openldap-devel] Bug#594712: slapd upgrade fails on dumping non-file-backed DBs

Peter Marschall peter at adpm.de
Sat Aug 28 15:35:26 UTC 2010


Package: slapd
Version: 2.4.23-4
Severity: normal
Tags: patch sid

Hi,

upgrading slapd to 2.4.23-4 failed because dumping the existing databases failed.
 
Error message:
--------------
(Reading database ... 244861 files and directories currently installed.)
Preparing to replace slapd 2.4.23-3pm1 (using slapd_2.4.23-4_amd64.deb) ...
Stopping OpenLDAP: slapd                                                                          [   OK   ]
  Dumping to /var/backups/slapd-2.4.23-3pm1: 
  - directory c=DE... done.
  - directory o=moth... slapcat: database doesn't support necessary operations.
failed.
dpkg: error processing slapd_2.4.23-4_amd64.deb (--install):
 subprocess new pre-installation script returned error exit status 1

Environment
-----------
- old version: 2.4.23-3pm1 (= 2.4.23-3 with patches for bugs 593878 & 593880 applied)
- databases using libdb4.8 4.8.30-1
- slapd.d/ based config
- SLAPD_CONF=/etc/ldap/slapd.d/ in /etc/default/slapd
- Database o=moth is a database that is not backed by file storage


The last point above is the key to the upgrade error.
Upgrade tries to dump databases that are not file-backed
(like e.g. ldap, ldap, passwd, monitor, config)

The attached patch tries to cope with the problem by checking whether
there is a storage directory for the database before trying to dump it,
and dumping only those DBs that have a storage directory.

Thanks Matthijs & Steve for caring about openldap in Debian

Bst regards
Peter






-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages slapd depends on:
ii  adduser                   3.112          add and remove users and groups
ii  coreutils                 8.5-1          GNU core utilities
ii  debconf [debconf-2.0]     1.5.35         Debian configuration management sy
ii  libc6                     2.11.2-2       Embedded GNU C Library: Shared lib
ii  libdb4.8                  4.8.30-1       Berkeley v4.8 Database Libraries [
ii  libgnutls26               2.8.6-1        the GNU TLS library - runtime libr
ii  libldap-2.4-2             2.4.23-4pm1    OpenLDAP libraries
ii  libltdl7                  2.2.6b-2       A system independent dlopen wrappe
ii  libperl5.10               5.10.1-14      shared Perl library
ii  libsasl2-2                2.1.23.dfsg1-5 Cyrus SASL - authentication abstra
ii  libslp1                   1.2.1-7.7      OpenSLP libraries
ii  libwrap0                  7.6.q-19       Wietse Venema's TCP wrappers libra
ii  lsb-base                  3.2-23.1       Linux Standard Base 3.2 init scrip
ii  perl [libmime-base64-perl 5.10.1-14      Larry Wall's Practical Extraction 
ii  psmisc                    22.11-1        utilities that use the proc file s
ii  unixodbc                  2.2.14p2-1     ODBC tools libraries

Versions of packages slapd recommends:
ii  libsasl2-modules          2.1.23.dfsg1-5 Cyrus SASL - pluggable authenticat

Versions of packages slapd suggests:
ii  ldap-utils                   2.4.23-4pm1 OpenLDAP utilities

-- Configuration Files:
/etc/default/slapd changed:
SLAPD_CONF="/etc/ldap/slapd.d"
SLAPD_USER="openldap"
SLAPD_GROUP="openldap"
SLAPD_PIDFILE=
SLAPD_SERVICES="ldap:/// ldaps:/// ldapi:///"
SLAPD_SENTINEL_FILE=/etc/ldap/noslapd
export KRB5_KTNAME="FILE:/etc/ldap/slapd.keytab"
SLAPD_OPTIONS="-o slp=(tree=experimental),(server-type=OpenLDAP),(server-version=2.4.23)"


-- debconf information:
  slapd/tlsciphersuite:
  shared/organization: adpm.de
* slapd/upgrade_slapcat_failure:
  slapd/backend: HDB
  slapd/allow_ldap_v2: false
  slapd/no_configuration: false
  slapd/move_old_database: true
  slapd/suffix_change: false
  slapd/dump_database_destdir: /var/backups/slapd-VERSION
  slapd/domain: adpm.de
  slapd/password_mismatch:
  slapd/invalid_config: true
  slapd/slurpd_obsolete:
  slapd/dump_database: when needed
  slapd/migrate_ldbm_to_bdb: false
  slapd/purge_database: false
-------------- next part --------------
--- openldap-2.4.23/debian/slapd.scripts-common	2010-08-28 16:47:18.883161909 +0200
+++ openldap-2.4.23/debian/slapd.scripts-common	2010-08-28 16:50:11.506732306 +0200
@@ -158,6 +158,8 @@
 	dir=`database_dumping_destdir`
 	echo >&2 "  Dumping to $dir: "
 	for suffix in `get_suffix`; do
+		dbdir=`get_directory $suffix`
+		if [ -n "$dbdir" ] && [ -d "$dbdir" ]; then
 		file="$dir/$suffix.ldif"
 		echo -n "  - directory $suffix... " >&2
 		# Need to support slapd.d migration from preinst
@@ -176,6 +178,7 @@
 			exit 1
 		fi
 		echo "done." >&2
+		fi
 	done
 }
 


More information about the Pkg-openldap-devel mailing list