Project

General

Profile

Actions

Bug #5575

closed

Upgrading rudder-inventory-ldap between two major OS versions makes slapd unable to operate because of BerkeleyDB

Added by Matthieu CERDA over 9 years ago. Updated over 9 years ago.

Status:
Released
Priority:
3
Category:
System integration
Target version:
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
WORKAROUND:
  • 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
      
  • 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 :)


Related issues 2 (0 open2 closed)

Related to Rudder - Bug #5705: A Rudder upgrade that leads to a different BDB version usage in slapd failsReleasedJonathan CLARKE2014-10-28Actions
Related to Rudder - Bug #5741: Upgrading rudder-inventory-ldap between two major OS versions makes slapd unable to operate because of BerkeleyDB (backport)ReleasedJonathan CLARKE2015-01-30Actions
Actions

Also available in: Atom PDF