# fix openldap-aai postinst user handling
upgrade_openldap () {
- # slapd postinst fails if this is false
+ pkg openldap-aai lt 2.3 || return 0
+
+ # slapd postinst fails if move_old_database is false
echo 'slapd slapd/move_old_database boolean true' | debconf-set-selections
+ pkgadd slapd
+
+ # openldap-aai postinst fails here because of database permissions
+ if ! apt-get -y install openldap-aai; then
+ chown -R openldap:openldap /var/lib/ldap # fix slapd
+ /etc/init.d/slapd restart
- # workaround for race condition in openldap-aai postinst
- apt-get -y$s install openldap-aai || true # postinst fails
- chown -R openldap:openldap /var/lib/ldap # fix slapd
- /etc/init.d/slapd restart
- dpkg --configure -a # try postinst again
+ # try openldap-aai postinst again (also re-enables slurpd)
+ dpkg --configure -a
+ fi
}
# fix postgresql deinstallation during upgrade
upgrade_postgresql () {
if check_services show 2>&1 | grep -qw postgresql; then
- pkgadd postgresql || apt-get -f install
+ pkgadd postgresql
fi
}