From: Valentin Vidic Date: Mon, 30 Jan 2012 13:18:00 +0000 (+0100) Subject: Handle AAI upgrade. X-Git-Tag: debian/6.0.1~14 X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=commitdiff_plain;h=593a505177247c3eedf76b9018b37c2b8be10789;p=carnet-upgrade.git Handle AAI upgrade. --- diff --git a/src/actions/main.queue b/src/actions/main.queue index a9a408b..a78f8a2 100644 --- a/src/actions/main.queue +++ b/src/actions/main.queue @@ -28,9 +28,8 @@ true install_keyrings # install new keys true restore_configs pkg munin-cn upgrade_munin # konacno, instalacija novih paketa -#pkg openldap-aai prepare_openldap -#pkg freeradius-aai upgrade_freeradius -#pkg openldap-aai upgrade_openldap +pkg freeradius-aai upgrade_freeradius +pkg openldap-aai upgrade_openldap pkg amavisd-new upgrade_amavis pkg apache2-cn upgrade_apache2 pkg postfix-cn upgrade_postfix diff --git a/src/functions.sh b/src/functions.sh index 1c1dcdf..27fa13d 100644 --- a/src/functions.sh +++ b/src/functions.sh @@ -881,9 +881,7 @@ upgrade_amavis () { # handle freerdius upgrade upgrade_freeradius () { - local template config_new password realm hostname basedn - - pkg freeradius-aai lt 2.1.3-0lenny0 || return 0 + pkg freeradius-aai lt 2.1.10-1 || return 0 # aai team prevents a clean upgrade cp -av /etc/freeradius /etc/freeradius.$backup_ext @@ -891,47 +889,11 @@ upgrade_freeradius () { pkgadd freeradius-aai } -# prepare for slapd upgrade (caused by freeradius installation) -prepare_openldap () { - pkg openldap-aai lt 2.4 || return 0 - - # openldap-aai expects org.ldif to exists - local ldif=/var/lib/ldap/org.ldif - local ldif_backup=/var/lib/carnet-upgrade/org.ldif - if [ -f $ldif ]; then - cp -v $ldif $ldif_backup - fi -} - -# fix openldap-aai postinst user handling +# handle openldap upgrade upgrade_openldap () { - pkg openldap-aai lt 2.4 || return 0 - - # slapd postinst fails if move_old_database is false - echo 'slapd slapd/move_old_database boolean true' | debconf-set-selections + # aai does not depend on the new openldap version pkgadd slapd - - # slapd removes org.ldif during switch from ldap -> openldap user - local ldif=/var/lib/ldap/org.ldif - local ldif_backup=/var/lib/carnet-upgrade/org.ldif - if [ -f $ldif_backup -a ! -f $ldif ]; then - cp -v $ldif_backup $ldif - fi - - # openldap-aai postinst fails here because of database permissions - apt-get -y install openldap-aai || true - chown -R openldap:openldap /var/lib/ldap - /etc/init.d/slapd restart - dpkg --configure -a - - # remove ldap user if openldap works - if getent passwd ldap > /dev/null && \ - getent passwd openldap > /dev/null && \ - pgrep -U openldap slapd > /dev/null - then - log "userdel ldap (replaced by openldap)" - userdel ldap || true - fi + pkgadd openldap-aai } # fix postgresql deinstallation during upgrade