Actions
Bug #5575
closedUpgrading rudder-inventory-ldap between two major OS versions makes slapd unable to operate because of BerkeleyDB
Status:
Released
Priority:
3
Assignee:
Jonathan CLARKE
Category:
System integration
Target version:
Pull Request:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:
Description
When an upgrade of Rudder is done after a major OS upgrade (that changes BerkeleyDB to a superior version), slapd refuses to do anything and breaks the update as the database is made for a previous version.
It especially happens during an upgrade from Ubuntu 12.04 to 14.04, like this:- Immediately after the upgrade, BDB switches from 5.1.25 to 5.1.29, making the old slapd from 12.04 unable to do anything
- It makes rudder-inventory-ldap unable to upgrade properly (can't run post/pre in/uninstall scripts) => dead end
- When forced to upgrade anyway, the expected BDB version bumps to 5.1 to 5.3, making a database export/reimport mandatory
- Upgrade to the latest Rudder version
- Before doing anything, export your current LDAP content:
/opt/rudder/sbin/slapcat -f /opt/rudder/etc/openldap/slapd.conf | gzip > /tmp/database-export.ldif.gz
- kill slapd:
killall -9 slapd
- Replace key elements (called by postinst/preinst scripts) by dummies to make the upgrade OK
- Create dummy.sh
#!/bin/sh exit 0
- Install it to the right places
cp /etc/init.d/rudder-slapd /etc/init.d/rudder-slapd.orig chmod +x dummy.sh cp dummy.sh /etc/init.d/rudder-slapd cp dummy.sh /opt/rudder/sbin/slapcat cp dummy.sh /opt/rudder/sbin/slapindex
- Create dummy.sh
- Upgrade Rudder to your target OS version (in this example, from Ubuntu precise to trusty)
- Restore the original init script:
cp /etc/init.d/rudder-slapd.orig /etc/init.d/rudder-slapd
- Import your LDAP backup
cd /var/rudder/ldap/openldap-data/ mv DB_CONFIG ~ rm -rf * cp ~/DB_CONFIG . zcat /tmp/database-export.ldif.gz | /opt/rudder/sbin/slapadd -q
- Restart slapd
service rudder-slapd restart
You should be OK now :)
Actions