Jan Wagner ревизий этого фрагмента 6 years ago. К ревизии
1 file changed, 1 insertion, 1 deletion
stretch2buster.sh
| @@ -79,7 +79,7 @@ sed s/2.debian.pool/0.de.pool/g /usr/share/chrony/chrony.conf > $CFG | |||
| 79 | 79 | /var/lib/dpkg/info/config-openssh-server-authorizedkeys-core.postinst configure | |
| 80 | 80 | ||
| 81 | 81 | # migrate unattended-upgrades config, modify the new config to our needs and place it where it is expected. | |
| 82 | - | # Keep LOCAL config if asked when upgrading (and run this snippet afterwards, when dpkg is not blocked anymore) | |
| 82 | + | # Keep LOCAL config if asked when upgrading (and run this snippet afterwards, when dpkg is not blocked anymore and choose 'package maintainer version' then, cause this is the one we are adjusting here) | |
| 83 | 83 | if [ -f /etc/apt/apt.conf.d/50unattended-upgrades.ucf-old ]; then CFG=/etc/apt/apt.conf.d/50unattended-upgrades.ucf-old; else CFG=/etc/apt/apt.conf.d/50unattended-upgrades; fi && \ | |
| 84 | 84 | cp /usr/share/unattended-upgrades/50unattended-upgrades /tmp/ && \ | |
| 85 | 85 | MAIL=$(grep ^Unattended-Upgrade::Mail $CFG | awk -F\" '{print $2}'); sed -i 's#//Unattended-Upgrade::Mail ".*";#Unattended-Upgrade::Mail "'${MAIL}'";#g' /tmp/50unattended-upgrades && \ | |
Jan Wagner ревизий этого фрагмента 6 years ago. К ревизии
1 file changed, 3 insertions
stretch2buster.sh
| @@ -115,6 +115,9 @@ systemctl restart nginx | |||
| 115 | 115 | # transition docker-ce to buster package | |
| 116 | 116 | DOCKER_VER="$(apt-cache policy docker-ce | grep debian-buster | head -1 | awk '{print $1}')" && [ -n "${DOCKER_VER}" ] && apt install docker-ce=${DOCKER_VER} docker-ce-cli=${DOCKER_VER} | |
| 117 | 117 | ||
| 118 | + | # transition icingaweb2 to buster package | |
| 119 | + | ICINGAWEB2_VER="$(apt-cache policy icingaweb2 | grep "\.buster" | head -1 | awk '{print $1}')" && [ -n "${ICINGAWEB2_VER}" ] && apt install icingaweb2=${ICINGAWEB2_VER} icingaweb2-common=${ICINGAWEB2_VER} icingaweb2-module-monitoring=${ICINGAWEB2_VER} php-icinga=${ICINGAWEB2_VER} icingacli=${ICINGAWEB2_VER} | |
| 120 | + | ||
| 118 | 121 | # provide /etc/dovecot/private/dovecot.key from default config to prevent failing to start dovecot | |
| 119 | 122 | ln -s /etc/ssl/private/ssl-cert-snakeoil.key /etc/dovecot/private/dovecot.key | |
| 120 | 123 | ||
Jan Wagner ревизий этого фрагмента 6 years ago. К ревизии
1 file changed, 1 insertion
stretch2buster.sh
| @@ -87,6 +87,7 @@ TIME=$(grep ^Unattended-Upgrade::Automatic-Reboot-Time $CFG | awk -F\" '{print $ | |||
| 87 | 87 | sed -i 's#// "origin=Debian,codename=${distro_codename}-updates"# "origin=Debian,codename=${distro_codename}-updates"#' /tmp/50unattended-upgrades && \ | |
| 88 | 88 | sed -i 's#//Unattended-Upgrade::Remove-Unused-Dependencies "false"#Unattended-Upgrade::Remove-Unused-Dependencies "true"#' /tmp/50unattended-upgrades && \ | |
| 89 | 89 | sed -i 's#//Unattended-Upgrade::Automatic-Reboot "false"#Unattended-Upgrade::Automatic-Reboot "true"#' /tmp/50unattended-upgrades && \ | |
| 90 | + | sed -i '/codename=..distro_codename.-updates/ s#^//# #' /tmp/50unattended-upgrades && \ | |
| 90 | 91 | /bin/bash /usr/bin/ucf --three-way --debconf-ok /tmp/50unattended-upgrades /etc/apt/apt.conf.d/50unattended-upgrades && \ | |
| 91 | 92 | [ "$CFG" == "/etc/apt/apt.conf.d/50unattended-upgrades.ucf-old" ] && mv $CFG /etc/apt/apt.conf.d/50unattended-upgrades.ucf-save | |
| 92 | 93 | ||
Jan Wagner ревизий этого фрагмента 6 years ago. К ревизии
1 file changed, 1 insertion, 1 deletion
stretch2buster.sh
| @@ -79,7 +79,7 @@ sed s/2.debian.pool/0.de.pool/g /usr/share/chrony/chrony.conf > $CFG | |||
| 79 | 79 | /var/lib/dpkg/info/config-openssh-server-authorizedkeys-core.postinst configure | |
| 80 | 80 | ||
| 81 | 81 | # migrate unattended-upgrades config, modify the new config to our needs and place it where it is expected. | |
| 82 | - | # Keep LOCAL config if asked when upgrading (and run this snippet afterwards) | |
| 82 | + | # Keep LOCAL config if asked when upgrading (and run this snippet afterwards, when dpkg is not blocked anymore) | |
| 83 | 83 | if [ -f /etc/apt/apt.conf.d/50unattended-upgrades.ucf-old ]; then CFG=/etc/apt/apt.conf.d/50unattended-upgrades.ucf-old; else CFG=/etc/apt/apt.conf.d/50unattended-upgrades; fi && \ | |
| 84 | 84 | cp /usr/share/unattended-upgrades/50unattended-upgrades /tmp/ && \ | |
| 85 | 85 | MAIL=$(grep ^Unattended-Upgrade::Mail $CFG | awk -F\" '{print $2}'); sed -i 's#//Unattended-Upgrade::Mail ".*";#Unattended-Upgrade::Mail "'${MAIL}'";#g' /tmp/50unattended-upgrades && \ | |
Jan Wagner ревизий этого фрагмента 6 years ago. К ревизии
1 file changed, 1 insertion, 1 deletion
stretch2buster.sh
| @@ -101,7 +101,7 @@ apt-get dist-upgrade | |||
| 101 | 101 | ||
| 102 | 102 | # Migrate (webserver) from php7.0 to php7.3 | |
| 103 | 103 | apt install $(dpkg -l |grep php7.0 | awk '/^i/ { print $2 }' |grep -v ^php7.0-opcache |sed s/php7.0/php/) | |
| 104 | - | ls -la /etc/php/7.0/*/conf.d/ | |
| 104 | + | a2dismod php7.0; a2enmod php7.3 && systemctl restart apache2; ls -la /etc/php/7.0/*/conf.d/ | |
| 105 | 105 | # php-fpm | |
| 106 | 106 | tail -10 /etc/php/7.0/fpm/pool.d/www.conf | |
| 107 | 107 | vi /etc/php/7.3/fpm/pool.d/www.conf | |
Jan Wagner ревизий этого фрагмента 6 years ago. К ревизии
1 file changed, 3 insertions
stretch2buster.sh
| @@ -114,6 +114,9 @@ systemctl restart nginx | |||
| 114 | 114 | # transition docker-ce to buster package | |
| 115 | 115 | DOCKER_VER="$(apt-cache policy docker-ce | grep debian-buster | head -1 | awk '{print $1}')" && [ -n "${DOCKER_VER}" ] && apt install docker-ce=${DOCKER_VER} docker-ce-cli=${DOCKER_VER} | |
| 116 | 116 | ||
| 117 | + | # provide /etc/dovecot/private/dovecot.key from default config to prevent failing to start dovecot | |
| 118 | + | ln -s /etc/ssl/private/ssl-cert-snakeoil.key /etc/dovecot/private/dovecot.key | |
| 119 | + | ||
| 117 | 120 | # Fixing systemd unit for chrooted unbound (https://bugs.debian.org/931583) | |
| 118 | 121 | mkdir -p /etc/systemd/system/unbound.service.d/ && cat > /etc/systemd/system/unbound.service.d/override.conf <<EOF | |
| 119 | 122 | [Service] | |
Jan Wagner ревизий этого фрагмента 6 years ago. К ревизии
1 file changed, 1 insertion, 1 deletion
stretch2buster.sh
| @@ -1,4 +1,4 @@ | |||
| 1 | - | Please also refer to http://www.debian.org/releases/buster/releasenotes and use your brain! | |
| 1 | + | Please also refer to http://www.debian.org/releases/buster/releasenotes and use your brain! If you can’t figure out what one of the commands below does, this is not for you. Expert mode only :) | |
| 2 | 2 | ||
| 3 | 3 | # Crossgrading ?!? | |
| 4 | 4 | [ "$(dpkg --print-architecture)" == "i386" ] && echo "How about crossgrading to amd64 as described in https://stbuehler.de/blog/article/2017/06/28/debian_stretch__upgrade_32-bit_to_64-bit.html?" | |
Jan Wagner ревизий этого фрагмента 6 years ago. К ревизии
1 file changed, 3 insertions, 1 deletion
stretch2buster.sh
| @@ -74,10 +74,12 @@ if [ -f /etc/chrony/chrony.conf.new ]; then CFG=/etc/chrony/chrony.conf.new; els | |||
| 74 | 74 | sed s/2.debian.pool/0.de.pool/g /usr/share/chrony/chrony.conf > $CFG | |
| 75 | 75 | ||
| 76 | 76 | # Fix our ssh pub key package configuration | |
| 77 | + | # Accept MAINTAINERS version (and run this snippet afterwards) | |
| 77 | 78 | [ -x /var/lib/dpkg/info/config-openssh-server-authorizedkeys-core.postinst ] && \ | |
| 78 | 79 | /var/lib/dpkg/info/config-openssh-server-authorizedkeys-core.postinst configure | |
| 79 | 80 | ||
| 80 | - | # migrate unattended-upgrades config | |
| 81 | + | # migrate unattended-upgrades config, modify the new config to our needs and place it where it is expected. | |
| 82 | + | # Keep LOCAL config if asked when upgrading (and run this snippet afterwards) | |
| 81 | 83 | if [ -f /etc/apt/apt.conf.d/50unattended-upgrades.ucf-old ]; then CFG=/etc/apt/apt.conf.d/50unattended-upgrades.ucf-old; else CFG=/etc/apt/apt.conf.d/50unattended-upgrades; fi && \ | |
| 82 | 84 | cp /usr/share/unattended-upgrades/50unattended-upgrades /tmp/ && \ | |
| 83 | 85 | MAIL=$(grep ^Unattended-Upgrade::Mail $CFG | awk -F\" '{print $2}'); sed -i 's#//Unattended-Upgrade::Mail ".*";#Unattended-Upgrade::Mail "'${MAIL}'";#g' /tmp/50unattended-upgrades && \ | |
Jan Wagner ревизий этого фрагмента 6 years ago. К ревизии
1 file changed, 3 insertions, 2 deletions
stretch2buster.sh
| @@ -68,9 +68,10 @@ if [ -f /etc/crontab.dpkg-new ]; then CFG=/etc/crontab.dpkg-new; else CFG=/etc/c | |||
| 68 | 68 | sed -i 's#root cd#root perl -e "sleep int(rand(300))" \&\& cd#' $CFG | |
| 69 | 69 | sed -i 's#root\ttest#root\tperl -e "sleep int(rand(3600))" \&\& test#' $CFG | |
| 70 | 70 | ||
| 71 | - | # chrony update | |
| 71 | + | # chrony update, modify the new config to our needs and place it where it is expected. | |
| 72 | + | # Keep LOCAL config if asked when upgrading | |
| 72 | 73 | if [ -f /etc/chrony/chrony.conf.new ]; then CFG=/etc/chrony/chrony.conf.new; else CFG=/etc/chrony/chrony.conf; fi | |
| 73 | - | sed -i s/2.debian.pool/0.de.pool/g $CFG | |
| 74 | + | sed s/2.debian.pool/0.de.pool/g /usr/share/chrony/chrony.conf > $CFG | |
| 74 | 75 | ||
| 75 | 76 | # Fix our ssh pub key package configuration | |
| 76 | 77 | [ -x /var/lib/dpkg/info/config-openssh-server-authorizedkeys-core.postinst ] && \ | |
Jan Wagner ревизий этого фрагмента 6 years ago. К ревизии
1 file changed, 5 insertions, 3 deletions
stretch2buster.sh
| @@ -77,13 +77,15 @@ sed -i s/2.debian.pool/0.de.pool/g $CFG | |||
| 77 | 77 | /var/lib/dpkg/info/config-openssh-server-authorizedkeys-core.postinst configure | |
| 78 | 78 | ||
| 79 | 79 | # migrate unattended-upgrades config | |
| 80 | + | if [ -f /etc/apt/apt.conf.d/50unattended-upgrades.ucf-old ]; then CFG=/etc/apt/apt.conf.d/50unattended-upgrades.ucf-old; else CFG=/etc/apt/apt.conf.d/50unattended-upgrades; fi && \ | |
| 80 | 81 | cp /usr/share/unattended-upgrades/50unattended-upgrades /tmp/ && \ | |
| 81 | - | MAIL=$(grep ^Unattended-Upgrade::Mail /etc/apt/apt.conf.d/50unattended-upgrades | awk -F\" '{print $2}'); sed -i 's#//Unattended-Upgrade::Mail ".*";#Unattended-Upgrade::Mail "'${MAIL}'";#g' /tmp/50unattended-upgrades && \ | |
| 82 | - | TIME=$(grep ^Unattended-Upgrade::Automatic-Reboot-Time /etc/apt/apt.conf.d/50unattended-upgrades | awk -F\" '{print $2}'); if [ "${TIME}" != "" ]; then sed -i 's#//Unattended-Upgrade::Automatic-Reboot-Time "02:00"#Unattended-Upgrade::Automatic-Reboot-Time "'${TIME}'"#' /tmp/50unattended-upgrades; fi | |
| 82 | + | MAIL=$(grep ^Unattended-Upgrade::Mail $CFG | awk -F\" '{print $2}'); sed -i 's#//Unattended-Upgrade::Mail ".*";#Unattended-Upgrade::Mail "'${MAIL}'";#g' /tmp/50unattended-upgrades && \ | |
| 83 | + | TIME=$(grep ^Unattended-Upgrade::Automatic-Reboot-Time $CFG | awk -F\" '{print $2}'); if [ "${TIME}" != "" ]; then sed -i 's#//Unattended-Upgrade::Automatic-Reboot-Time "02:00"#Unattended-Upgrade::Automatic-Reboot-Time "'${TIME}'"#' /tmp/50unattended-upgrades; fi | |
| 83 | 84 | sed -i 's#// "origin=Debian,codename=${distro_codename}-updates"# "origin=Debian,codename=${distro_codename}-updates"#' /tmp/50unattended-upgrades && \ | |
| 84 | 85 | sed -i 's#//Unattended-Upgrade::Remove-Unused-Dependencies "false"#Unattended-Upgrade::Remove-Unused-Dependencies "true"#' /tmp/50unattended-upgrades && \ | |
| 85 | 86 | sed -i 's#//Unattended-Upgrade::Automatic-Reboot "false"#Unattended-Upgrade::Automatic-Reboot "true"#' /tmp/50unattended-upgrades && \ | |
| 86 | - | /bin/bash /usr/bin/ucf --three-way --debconf-ok /tmp/50unattended-upgrades /etc/apt/apt.conf.d/50unattended-upgrades | |
| 87 | + | /bin/bash /usr/bin/ucf --three-way --debconf-ok /tmp/50unattended-upgrades /etc/apt/apt.conf.d/50unattended-upgrades && \ | |
| 88 | + | [ "$CFG" == "/etc/apt/apt.conf.d/50unattended-upgrades.ucf-old" ] && mv $CFG /etc/apt/apt.conf.d/50unattended-upgrades.ucf-save | |
| 87 | 89 | ||
| 88 | 90 | ## phpmyadmin | |
| 89 | 91 | if [ -f /etc/phpmyadmin/config.inc.php.dpkg-new ]; then CFG=/etc/phpmyadmin/config.inc.php.dpkg-new; \ | |