X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=src%2Ffunctions.sh;h=46bb6f6fa9340635d70667556bed8b99cc476923;hb=9cca6edc89d02bb8820c4cb1b65707c38dab8758;hp=9d35ceb70a500c970d08a334169bb5b8beb4d6d5;hpb=5aae55b00e9d4d3ee608df184b4253dab7a52783;p=carnet-upgrade.git diff --git a/src/functions.sh b/src/functions.sh index 9d35ceb..46bb6f6 100644 --- a/src/functions.sh +++ b/src/functions.sh @@ -286,7 +286,7 @@ check_apache_version () { if pkg apache-cn && ! pkg apache2-cn; then notice " -Prije prelaska na Debian Etch potrebno je napraviti nadogradnju sa apache 1.3 na apache 2.0. +Prije prelaska na Debian Etch potrebno je napraviti nadogradnju sa Apache 1.3 na Apache 2.0. Pokrenite: 'apt-get install apache2-cn' @@ -594,38 +594,31 @@ upgrade_libc () { DEBIAN_FRONTEND=noninteractive pkgadd libc6 } -# upgrade apache -> apache2 -upgrade_apache () { - local delpkg p +# upgrade apache2 to etch +upgrade_apache2 () { + local package packages - # bugfix for apache2-cn postinst - mkdir -p /etc/apache2 - touch /etc/apache2/httpd.conf + # php-suhosin-cn causes removal of applications on dist-upgrade + # because of php5 only dependencies + pkgrm php-suhosin-cn - # temporary remove packages conflicting with apache2 - delpkg="" - for p in aosi-aai aosi-www-aai \ - php4-cn php4-odbc php4-xslt \ - squirrelmail-cn; do - - # remember installed packages - if pkg $p; then - delpkg="$delpkg $p" - fi + for package in \ + libapache2-mod-php4 \ + php4-cli \ + php4-cgi \ + php4-cn \ + apache2-cn \ + php4-odbc \ + php4-suhosin + do + if pkg $package; then + packages="$packages $package" + fi done - # remove (but not purge) problematic packages - if [ "$delpkg" ]; then - eval apt-get --yes remove $delpkg - fi - - # remove old apache - pkgrm apache apache-common - - # install new packages - eval pkgadd apache2-cn apache2-mpm-prefork \ - php4-cn libapache2-mod-php4 \ - $delpkg + for package in $packages; do + pkgadd $package + done } upgrade_amavis () { @@ -657,13 +650,32 @@ upgrade_amavis () { # fix openldap-aai postinst user handling upgrade_openldap () { - #pkgrm openldap-cn # deprecated + # slapd postinst fails if this is false + echo 'slapd slapd/move_old_database boolean true' | debconf-set-selections + + # 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 } +# fix postgresql deinstallation during upgrade +upgrade_postgresql () { + if check_services show 2>&1 | grep -qw postgresql; then + pkgadd postgresql || apt-get -f install + fi +} + +# upgrade the MTA +upgrade_postfix () { + pkgadd postfix-cn + + if pkg postgrey; then + pkgrm postgrey # not used by postfix-cn anymore + fi +} + get_variable () { local name=$1 file=$2 val @@ -707,16 +719,6 @@ upgrade_dovecot () { fi } -# vsftpd.postinst tries to start vsftpd so make sure it is not running -upgrade_vsftpd () { - if [ -x /etc/init.d/vsftpd ]; then - /etc/init.d/vsftpd stop || true - fi - - pkg vsftpd && pkgadd vsftpd - pkg vsftpd-cn && pkgadd vsftpd-cn -} - # fix /etc/dpkg/dpkg.cfg comment_force_overwrite () { if [ -f /etc/dpkg/dpkg.cfg ]; then