X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=src%2Ffunctions.sh;h=34b9022a488054f8e8e88d432cf096b36da887c5;hb=6d042d931b7f42f77624c866e91ef8dcc90c5b99;hp=2fbcacd58ccdf81d5a3c181edb3ef930961e04f2;hpb=50f8f7af6ef50eb419bf55e062a4b2b1a9943171;p=carnet-upgrade.git diff --git a/src/functions.sh b/src/functions.sh index 2fbcacd..34b9022 100644 --- a/src/functions.sh +++ b/src/functions.sh @@ -367,7 +367,7 @@ check_upgrade () { if [ "$upgrade" ]; then notice " -Prije prelaska na Debian Squeeze potrebno je napraviti nadogradnju ovih paketa: +Prije prelaska na Debian jessie potrebno je napraviti nadogradnju ovih paketa: $upgrade Pokrenite: @@ -744,6 +744,11 @@ restore_configs () { fi } +# load various debconf defaults +debconf_preload () { + echo libc6 libraries/restart-without-asking boolean true | debconf-set-selections +} + # temporary disable listchanges packages to reduce clutter during upgrade apt_listchanges () { local file command=$1 @@ -861,17 +866,11 @@ pkgupgrade () { fi } -# make a silent upgrade to new libc6 -upgrade_libc () { - DEBIAN_FRONTEND=noninteractive pkgupgrade libc6 libc6-dev tzdata -} - # upgrade apache2/php5 upgrade_apache2 () { pkgrm apache-common # prevents installation of apache2-suexec - pkgrm php5-suhosin # not available for wheezy pkgupgrade libapache2-mod-php5 php5-cli php5-cn apache2-cn \ - php5-odbc + php5-odbc mod-security-cn } upgrade_amavis () { @@ -918,7 +917,15 @@ upgrade_postfix () { # upgrade the IMAP server upgrade_dovecot() { - if [ ! -f /etc/dovecot/conf.d/95-local ]; then + local local_conf=/etc/dovecot/conf.d/95-${backup_ext}.conf + + if [ -f /etc/dovecot/conf.d/95-local -a ! -f $local_conf ]; then + mv /etc/dovecot/conf.d/95-local $local_conf + sed -i 's/\/usr\/lib\/dovecot\/modules\/imap/\/usr\/lib\/dovecot\/modules/g' $local_conf + /etc/init.d/dovecot restart + fi + + if [ ! -f $local_conf ]; then pkgrm dovecot-cn # restore config @@ -948,7 +955,8 @@ upgrade_dovecot() { # install new version and restore local changes pkgadd dovecot-core - doveconf -n -c /etc/dovecot/dovecot.conf.$backup_ext > /etc/dovecot/conf.d/95-local + doveconf -n -c /etc/dovecot/dovecot.conf.$backup_ext > $local_conf + sed -i 's/\/user\/lib\/dovecot\/modules\/imap/\/usr\/lib\/dovecot\/modules/g' $local_conf pkgadd dovecot-cn fi @@ -981,6 +989,19 @@ upgrade_mailman() { fi } +# manual upgrade of kernel due to new packet name +upgrade_kernel() { + if pkg kernel-2.6-cn; then + pkgrm kernel-2.6-cn + + if pkg grub-pc; then + pkgadd kernel-cn grub-pc + else + pkgadd kernel-cn + fi + fi +} + get_variable () { local name=$1 file=$2 val @@ -992,6 +1013,17 @@ get_variable () { echo $val } +# switch to rsyslog +upgrade_syslog() { + # libc6-dev prevents upgrade + if pkg libc6-dev; then + pkgrm libc6-dev + fi + + pkgadd rsyslog + dpkg -P sysklogd klogd +} + # restore munin configs for silent upgrade upgrade_munin () { local config backup hostname domain @@ -1043,12 +1075,12 @@ check_archives_space() { fi } -# calculate the list of linux-image packages from kernel-2.6-cn dependencies +# calculate the list of linux-image packages from kernel-cn dependencies get_cn_kernels() { local cn_kernels linux_images metapkg pkg cn_kernels= - linux_images=$(apt-cache show kernel-2.6-cn | grep ^Depends: \ + linux_images=$(apt-cache show kernel-cn | grep ^Depends: \ | grep -o 'linux-image[^, ]*') for metapkg in $linux_images; do pkg=$(apt-cache show $metapkg | grep ^Depends: \ @@ -1080,10 +1112,10 @@ check_kernel_space() { log "Kernel package: $pkg" log "Kernel size: ${kernel_size}MB" - if LC_ALL=C apt-get -s install kernel-2.6-cn 2>/dev/null \ - | grep -q '^kernel-2.6-cn is already the newest version.$' + if LC_ALL=C apt-get -s install kernel-cn 2>/dev/null \ + | grep -q '^kernel-cn is already the newest version.$' then - log "Not checking free space in /: kernel-2.6-cn already installed" + log "Not checking free space in /: kernel-cn already installed" return fi