From: Valentin Vidic Date: Wed, 26 Mar 2008 15:31:36 +0000 (+0100) Subject: Fixes for openldap and postgresql upgrade problems. X-Git-Tag: debian/4.0.1~14 X-Git-Url: http://ftp.carnet.hr/pub/carnet-debian/scm?a=commitdiff_plain;h=6e411345cb8c762cc69ce4ad202344ece984c9d4;p=carnet-upgrade.git Fixes for openldap and postgresql upgrade problems. --- 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 }