From 6e411345cb8c762cc69ce4ad202344ece984c9d4 Mon Sep 17 00:00:00 2001 From: Valentin Vidic Date: Wed, 26 Mar 2008 16:31:36 +0100 Subject: [PATCH] Fixes for openldap and postgresql upgrade problems. --- src/functions.sh | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/functions.sh b/src/functions.sh index 46bb6f6..2b6d3a0 100644 --- a/src/functions.sh +++ b/src/functions.sh @@ -650,20 +650,26 @@ upgrade_amavis () { # 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 } -- 1.7.10.4