Database upgrade/migration fails with nested db directories (lucid to precise)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
openldap (Debian) |
Fix Released
|
Undecided
|
Unassigned | ||
openldap (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Precise |
Won't Fix
|
Medium
|
Unassigned |
Bug Description
Hi,
I've just performed an upgrade of our LDAP server on Ubuntu 10.04.4 LTS to Ubuntu 12.04 (I acknowledge this upgrade path is not officially supported yet).
The incompatible database upgrading process in the preinst/postinst files failed in the following scenario.
We have two suffixes/databases at the following paths:-
* /var/lib/ldap
* /var/lib/
The preinst database dumping part of the process worked just fine and created the appropriate LDIF files under /var/backup/
"""
Loading from /var/backups/
- directory dc=REDACTEDs,
Loading the database from the LDIF dump failed with the following
error while running slapadd:
4fbdfebf olcDbDirectory: value #0: invalid path: No such file or directory
4fbdfebf config error processing olcDatabase=
slapadd: bad configuration directory!
"""
This is because when move_incompatib
I've tested a tentative fix and that's to patch the two find commands (one in is_empty_dir() one in move_old_
The simple and very tentative patch for this is:-
"""
# diff -u slapd.scripts-
--- slapd.scripts-
+++ slapd.scripts-
@@ -391,7 +391,7 @@
echo -n " - directory $suffix... " >&2
mkdir -p "$backupdir"
find "$databasedir" -mindepth 1 -maxdepth 1 \
- -exec mv {} "$backupdir" \;
+ -type f -exec mv {} "$backupdir" \;
echo done. >&2
else
cat >&2 <<EOF
@@ -728,7 +728,7 @@
# (i.e., contains no files except for an optional DB_CONFIG).
# Usage: if is_empty_dir "$dir"; then ... fi
- output=`find "$1" -mindepth 1 -maxdepth 1 \! -name DB_CONFIG 2>/dev/null`
+ output=`find "$1" -mindepth 1 -maxdepth 1 -type f \! -name DB_CONFIG 2>/dev/null`
if [ -n "$output" ]; then
return 1
else
"""
Related branches
Changed in openldap (Ubuntu): | |
importance: | Undecided → Medium |
status: | New → Confirmed |
Changed in openldap (Ubuntu Precise): | |
status: | New → Confirmed |
importance: | Undecided → Medium |
tags: | added: lucid2precise |
tags: | added: patch |
Changed in openldap (Ubuntu Precise): | |
assignee: | Rolf Leggewie (r0lf) → nobody |
(If requested I can provide a suitable debdiff for the proposed fix)