X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=src%2Ffunctions.sh;h=2dde2af7338203a7d7985baab68d2e7ee21f324a;hb=31c84e800cd8eeb50d94d7bd2e6ad55291058154;hp=2e7a776495bedc205ead8052a0deedc122c516ef;hpb=7be409085cb525c489abaee15edf87d37ca034c8;p=carnet-upgrade.git diff --git a/src/functions.sh b/src/functions.sh index 2e7a776..2dde2af 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: @@ -530,16 +530,18 @@ create_sources_list () { # backup old version if [ -f $sl -a ! -f $sl.$backup_ext ]; then - cp -av $sl $sl.$backup_ext + cp -v $sl $sl.$backup_ext fi # install new version - cp -av $sl_new $sl + cp -v $sl_new $sl notice "Novi sadrzaj datoteke /etc/apt/sources.list: `cat /etc/apt/sources.list`" fi + # make sure permissions are correct + chmod 0644 $sl rm $sl_new } @@ -744,6 +746,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 @@ -864,7 +871,6 @@ pkgupgrade () { # 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 mod-security-cn } @@ -879,11 +885,27 @@ upgrade_amavis () { fi done + # workaround for insserv complaining + if [ -x /sbin/insserv ]; then + if [ -r /etc/init.d/amavis.amavisd-new ]; then + /sbin/insserv amavis.amavisd-new + fi + fi + # install new packages pkgadd amavisd-cn amavisd-new + # workaround for insserv complaining + if [ -x /sbin/insserv ]; then + if [ -r /etc/init.d/amavis.amavisd-new ]; then + /sbin/insserv amavis.amavisd-new + fi + fi + # start new packages - /etc/init.d/amavisd-cn restart + ### By zelja, nema vise amavisd-cn, vjerujemo systemd-u + ### /etc/init.d/amavisd-cn restart + /etc/init.d/amavis restart } # handle mysql 5.0 to 5.1 upgrade @@ -913,7 +935,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 @@ -943,7 +973,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 @@ -1000,6 +1031,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