Jan Wagner ревизий этого фрагмента 8 years ago. К ревизии
1 file changed, 8 insertions, 7 deletions
jessie2stretch.sh
| @@ -142,13 +142,14 @@ pg_dropcluster 9.4 main | |||
| 142 | 142 | ||
| 143 | 143 | # remove old squeeze packages left around (keep eyes open!) | |
| 144 | 144 | apt-get autoremove | |
| 145 | - | aptitude search ?obsolete | |
| 146 | - | dpkg -l | grep etch | grep -v xen | grep -v unbound | grep -v finch | awk '{print $2}' | xargs aptitude -y purge | |
| 147 | - | dpkg -l | grep lenny | grep -v xen | awk '{print $2}' | xargs aptitude -y purge | |
| 148 | - | dpkg -l | grep -E 'deb6|squeeze' | grep -v xen | awk '{print $2}' | xargs aptitude -y purge | |
| 149 | - | dpkg -l | grep -E 'deb7|wheezy' | grep -v xen | grep -v -E 'linux-image|mailscanner|openswan|debian-security-support' | awk '{print $2}' | xargs aptitude -y purge | |
| 150 | - | dpkg -l | grep -E 'deb8|jessie' | grep -v xen | grep -v -E 'linux-image|debian-security-support' | awk '{print $2}' | xargs aptitude -y purge | |
| 151 | - | aptitude -y install deborphan && deborphan | grep -v xen | grep -v libpam-cracklib | xargs aptitude -y purge | |
| 145 | + | apt-get purge $(dpkg -l | awk '/gcc-4.9/ { print $2 }') | |
| 146 | + | apt-get purge $(aptitude search ?obsolete | grep -v linux-image | awk '/^i/ { print $2 }') | |
| 147 | + | apt-get purge $(dpkg -l | grep etch | grep -v xen | grep -v unbound | grep -v finch | awk '/^rc/ { print $2 }') | |
| 148 | + | apt-get purge $(dpkg -l | grep lenny | grep -v xen | awk '/^rc/ { print $2 }') | |
| 149 | + | apt-get purge $(dpkg -l | grep -E 'deb6|squeeze' | grep -v xen | awk '/^rc/ { print $2 }') | |
| 150 | + | apt-get purge $(dpkg -l | grep -E 'deb7|wheezy' | grep -v xen | grep -v -E 'linux-image|mailscanner|openswan|debian-security-support' | awk '/^rc/ { print $2 }') | |
| 151 | + | apt-get purge $(dpkg -l | grep -E 'deb8|jessie' | grep -v xen | grep -v -E 'linux-image|debian-security-support' | awk '{ print $2 }') | |
| 152 | + | aptitude -y install deborphan && apt-get purge $(deborphan | grep -v xen | grep -v libpam-cracklib | awk '/^rc/ { print $2 }') | |
| 152 | 153 | apt-get purge $(dpkg -l | awk '/^rc/ { print $2 }') | |
| 153 | 154 | ||
| 154 | 155 | # for the brave YoloOps crowd | |
Jan Wagner ревизий этого фрагмента 8 years ago. К ревизии
1 file changed, 2 insertions, 2 deletions
jessie2stretch.sh
| @@ -42,8 +42,8 @@ aptitude search "~ahold" | grep "^.h" | |||
| 42 | 42 | dpkg --get-selections | grep hold | |
| 43 | 43 | ||
| 44 | 44 | # unmark packages auto | |
| 45 | - | aptitude unmarkauto vim net-tools | |
| 46 | - | aptitude unmarkauto monitoring-plugins-standard monitoring-plugins-common monitoring-plugins-basic | |
| 45 | + | aptitude unmarkauto vim net-tools && \ | |
| 46 | + | aptitude unmarkauto monitoring-plugins-standard monitoring-plugins-common monitoring-plugins-basic && \ | |
| 47 | 47 | aptitude unmarkauto $(dpkg-query -W 'linux-image-3.16*' | cut -f1) | |
| 48 | 48 | ||
| 49 | 49 | # have a look into required and free disk space | |
Jan Wagner ревизий этого фрагмента 8 years ago. К ревизии
1 file changed, 18 insertions, 18 deletions
jessie2stretch.sh
| @@ -66,19 +66,19 @@ EOF | |||
| 66 | 66 | # minimal system upgrade (keep sysvinit / see http://noone.org/talks/debian-ohne-systemd/debian-ohne-systemd-clt.html#%2811%29) | |
| 67 | 67 | aptitude upgrade | |
| 68 | 68 | ||
| 69 | - | # (re)enable wheel | |
| 70 | - | if [ -f /etc/pam.d/su.dpkg-new ]; then CFG=/etc/pam.d/su.dpkg-new; else CFG=/etc/pam.d/su; fi | |
| 71 | - | sed -i "s/# auth required pam_wheel.so/auth required pam_wheel.so/" $CFG | |
| 72 | - | ||
| 73 | - | # (re)configure snmpd | |
| 74 | - | COMMUNITY="mycommunity"; \ | |
| 75 | - | if [ -f /etc/snmp/snmpd.conf.dpkg-new ]; then CFG=/etc/snmp/snmpd.conf.dpkg-new; \ | |
| 76 | - | else CFG=/etc/snmp/snmpd.conf; fi | |
| 77 | - | sed -i "s^#rocommunity secret 10.0.0.0/16^rocommunity $COMMUNITY^g" $CFG | |
| 78 | - | sed -i s/#agentAddress/agentAddress/ $CFG | |
| 79 | - | sed -i "s/^ rocommunity public/# rocommunity public/" $CFG | |
| 80 | - | sed -i "s/^ rocommunity6 public/# rocommunity6 public/" $CFG | |
| 81 | - | sed -i "s/agentAddress udp:127/#agentAddress udp:127/" $CFG | |
| 69 | + | ## (re)enable wheel | |
| 70 | + | #if [ -f /etc/pam.d/su.dpkg-new ]; then CFG=/etc/pam.d/su.dpkg-new; else CFG=/etc/pam.d/su; fi | |
| 71 | + | #sed -i "s/# auth required pam_wheel.so/auth required pam_wheel.so/" $CFG | |
| 72 | + | ||
| 73 | + | ## (re)configure snmpd | |
| 74 | + | #COMMUNITY="mycommunity"; \ | |
| 75 | + | #if [ -f /etc/snmp/snmpd.conf.dpkg-new ]; then CFG=/etc/snmp/snmpd.conf.dpkg-new; \ | |
| 76 | + | # else CFG=/etc/snmp/snmpd.conf; fi | |
| 77 | + | #sed -i "s^#rocommunity secret 10.0.0.0/16^rocommunity $COMMUNITY^g" $CFG | |
| 78 | + | #sed -i s/#agentAddress/agentAddress/ $CFG | |
| 79 | + | #sed -i "s/^ rocommunity public/# rocommunity public/" $CFG | |
| 80 | + | #sed -i "s/^ rocommunity6 public/# rocommunity6 public/" $CFG | |
| 81 | + | #sed -i "s/agentAddress udp:127/#agentAddress udp:127/" $CFG | |
| 82 | 82 | ||
| 83 | 83 | ## fix our xen modification | |
| 84 | 84 | #rm -rf /etc/grub.d/09_linux_xen | |
| @@ -104,10 +104,10 @@ cat >> $CFG <<EOF | |||
| 104 | 104 | ||
| 105 | 105 | EOF | |
| 106 | 106 | ||
| 107 | - | # randomize crontab | |
| 108 | - | if [ -f /etc/crontab.dpkg-new ]; then CFG=/etc/crontab.dpkg-new; else CFG=/etc/crontab; fi | |
| 109 | - | sed -i 's#root cd#root perl -e "sleep int(rand(300))" \&\& cd#' $CFG | |
| 110 | - | sed -i 's#root\ttest#root\tperl -e "sleep int(rand(3600))" \&\& test#' $CFG | |
| 107 | + | ## randomize crontab | |
| 108 | + | #if [ -f /etc/crontab.dpkg-new ]; then CFG=/etc/crontab.dpkg-new; else CFG=/etc/crontab; fi | |
| 109 | + | #sed -i 's#root cd#root perl -e "sleep int(rand(300))" \&\& cd#' $CFG | |
| 110 | + | #sed -i 's#root\ttest#root\tperl -e "sleep int(rand(3600))" \&\& test#' $CFG | |
| 111 | 111 | ||
| 112 | 112 | ## phpmyadmin | |
| 113 | 113 | #if [ -f /etc/phpmyadmin/config.inc.php.dpkg-new ]; then CFG=/etc/phpmyadmin/config.inc.php.dpkg-new; \ | |
| @@ -120,7 +120,7 @@ sed -i 's#root\ttest#root\tperl -e "sleep int(rand(3600))" \&\& test#' $CFG | |||
| 120 | 120 | systemctl enable shorewall | |
| 121 | 121 | ||
| 122 | 122 | # full-upgrade | |
| 123 | - | aptitude full-upgrade | |
| 123 | + | apt-get dist-upgrade | |
| 124 | 124 | ||
| 125 | 125 | # Upgrade postgres | |
| 126 | 126 | # See also https://www.debian.org/releases/stretch/amd64/release-notes/ch-information.de.html#plperl | |
Jan Wagner ревизий этого фрагмента 8 years ago. К ревизии
1 file changed, 16 insertions
jessie2stretch.sh
| @@ -88,6 +88,22 @@ sed -i "s/agentAddress udp:127/#agentAddress udp:127/" $CFG | |||
| 88 | 88 | if [ -f /etc/chrony/chrony.conf.new ]; then CFG=/etc/chrony/chrony.conf.new; else CFG=/etc/chrony/chrony.conf; fi | |
| 89 | 89 | sed -i s/2.debian.pool/0.de.pool/g $CFG | |
| 90 | 90 | ||
| 91 | + | # migrate unattended-upgrades config | |
| 92 | + | if [ -f /etc/apt/apt.conf.d/50unattended-upgrades.dpkg-new ]; then CFG=/etc/apt/apt.conf.d/50unattended-upgrades.dpkg-new; \ | |
| 93 | + | else CFG=/etc/apt/apt.conf.d/50unattended-upgrades; fi | |
| 94 | + | sed -i s/jessie/stretch/g $CFG | |
| 95 | + | sed -i s/crontrib/contrib/g $CFG | |
| 96 | + | sed -i "s#// If automatic reboot is enabled and needed, reboot at the specific#// Automatically reboot even if there are users currently logged in.\n//Unattended-Upgrade::Automatic-Reboot-WithUsers \"true\";\n\n// If automatic reboot is enabled and needed, reboot at the specific#" $CFG | |
| 97 | + | cat >> $CFG <<EOF | |
| 98 | + | ||
| 99 | + | // Enable logging to syslog. Default is False | |
| 100 | + | // Unattended-Upgrade::SyslogEnable "false"; | |
| 101 | + | ||
| 102 | + | // Specify syslog facility. Default is daemon | |
| 103 | + | // Unattended-Upgrade::SyslogFacility "daemon"; | |
| 104 | + | ||
| 105 | + | EOF | |
| 106 | + | ||
| 91 | 107 | # randomize crontab | |
| 92 | 108 | if [ -f /etc/crontab.dpkg-new ]; then CFG=/etc/crontab.dpkg-new; else CFG=/etc/crontab; fi | |
| 93 | 109 | sed -i 's#root cd#root perl -e "sleep int(rand(300))" \&\& cd#' $CFG | |
Jan Wagner ревизий этого фрагмента 8 years ago. К ревизии
1 file changed, 1 insertion, 1 deletion
jessie2stretch.sh
| @@ -86,7 +86,7 @@ sed -i "s/agentAddress udp:127/#agentAddress udp:127/" $CFG | |||
| 86 | 86 | ||
| 87 | 87 | # chrony update | |
| 88 | 88 | if [ -f /etc/chrony/chrony.conf.new ]; then CFG=/etc/chrony/chrony.conf.new; else CFG=/etc/chrony/chrony.conf; fi | |
| 89 | - | sed -i s/debian.pool/de.pool/g $CFG | |
| 89 | + | sed -i s/2.debian.pool/0.de.pool/g $CFG | |
| 90 | 90 | ||
| 91 | 91 | # randomize crontab | |
| 92 | 92 | if [ -f /etc/crontab.dpkg-new ]; then CFG=/etc/crontab.dpkg-new; else CFG=/etc/crontab; fi | |
Jan Wagner ревизий этого фрагмента 8 years ago. К ревизии
1 file changed, 4 insertions
jessie2stretch.sh
| @@ -10,6 +10,10 @@ rm -rf /etc/network/options /etc/environment | |||
| 10 | 10 | # migrate over to systemd (before the upgrade) | |
| 11 | 11 | aptitude install systemd | |
| 12 | 12 | ||
| 13 | + | # Disable loading defaults.vim | |
| 14 | + | echo '" disable the loading of defaults.vim' >> /etc/vim/vimrc.local | |
| 15 | + | echo "let g:skip_defaults_vim = 1" >> /etc/vim/vimrc.local | |
| 16 | + | ||
| 13 | 17 | # are there 3rd party packages installed? (https://www.debian.org/releases/stretch/amd64/release-notes/ch-upgrading.de.html#system-status) | |
| 14 | 18 | aptitude search '~i(!~ODebian)' | |
| 15 | 19 | ||
Jan Wagner ревизий этого фрагмента 8 years ago. К ревизии
1 file changed, 1 insertion, 1 deletion
jessie2stretch.sh
| @@ -14,7 +14,7 @@ aptitude install systemd | |||
| 14 | 14 | aptitude search '~i(!~ODebian)' | |
| 15 | 15 | ||
| 16 | 16 | # check for ftp protocol in sources lists (https://www.debian.org/releases/stretch/amd64/release-notes/ch-information.en.html#deprecation-of-ftp-apt-mirrors) | |
| 17 | - | grep --color "deb ftp" /etc/apt/sources.list* | |
| 17 | + | rgrep --color "deb ftp" /etc/apt/sources.list* | |
| 18 | 18 | ||
| 19 | 19 | # Transition and remove entries from older releases | |
| 20 | 20 | sed -i /etch/d /etc/apt/sources.list* | |
Jan Wagner ревизий этого фрагмента 8 years ago. К ревизии
1 file changed, 13 insertions, 7 deletions
jessie2stretch.sh
| @@ -6,7 +6,16 @@ dpkg-reconfigure locales | |||
| 6 | 6 | ||
| 7 | 7 | # remove unused config file | |
| 8 | 8 | rm -rf /etc/network/options /etc/environment | |
| 9 | - | ||
| 9 | + | ||
| 10 | + | # migrate over to systemd (before the upgrade) | |
| 11 | + | aptitude install systemd | |
| 12 | + | ||
| 13 | + | # are there 3rd party packages installed? (https://www.debian.org/releases/stretch/amd64/release-notes/ch-upgrading.de.html#system-status) | |
| 14 | + | aptitude search '~i(!~ODebian)' | |
| 15 | + | ||
| 16 | + | # check for ftp protocol in sources lists (https://www.debian.org/releases/stretch/amd64/release-notes/ch-information.en.html#deprecation-of-ftp-apt-mirrors) | |
| 17 | + | grep --color "deb ftp" /etc/apt/sources.list* | |
| 18 | + | ||
| 10 | 19 | # Transition and remove entries from older releases | |
| 11 | 20 | sed -i /etch/d /etc/apt/sources.list* | |
| 12 | 21 | sed -i /lenny/d /etc/apt/sources.list* | |
| @@ -29,9 +38,8 @@ aptitude search "~ahold" | grep "^.h" | |||
| 29 | 38 | dpkg --get-selections | grep hold | |
| 30 | 39 | ||
| 31 | 40 | # unmark packages auto | |
| 32 | - | aptitude unmarkauto vim | |
| 41 | + | aptitude unmarkauto vim net-tools | |
| 33 | 42 | aptitude unmarkauto monitoring-plugins-standard monitoring-plugins-common monitoring-plugins-basic | |
| 34 | - | aptitude unmarkauto open-vm-tools-dkms ifenslave | |
| 35 | 43 | aptitude unmarkauto $(dpkg-query -W 'linux-image-3.16*' | cut -f1) | |
| 36 | 44 | ||
| 37 | 45 | # have a look into required and free disk space | |
| @@ -51,9 +59,6 @@ EOF | |||
| 51 | 59 | # update aptitude first | |
| 52 | 60 | [ "$(which aptitude)" = "/usr/bin/aptitude" ] && aptitude install aptitude | |
| 53 | 61 | ||
| 54 | - | # migrate over to systemd | |
| 55 | - | aptitude install systemd | |
| 56 | - | ||
| 57 | 62 | # minimal system upgrade (keep sysvinit / see http://noone.org/talks/debian-ohne-systemd/debian-ohne-systemd-clt.html#%2811%29) | |
| 58 | 63 | aptitude upgrade | |
| 59 | 64 | ||
| @@ -98,6 +103,7 @@ systemctl enable shorewall | |||
| 98 | 103 | aptitude full-upgrade | |
| 99 | 104 | ||
| 100 | 105 | # Upgrade postgres | |
| 106 | + | # See also https://www.debian.org/releases/stretch/amd64/release-notes/ch-information.de.html#plperl | |
| 101 | 107 | if [ "$(dpkg -l | grep "postgresql-9.4" | awk {'print $2'})" = "postgresql-9.4" ]; then \ | |
| 102 | 108 | aptitude install postgresql-9.6 && \ | |
| 103 | 109 | pg_dropcluster --stop 9.6 main && \ | |
| @@ -123,7 +129,7 @@ dpkg -l | grep -E 'deb6|squeeze' | grep -v xen | awk '{print $2}' | xargs aptitu | |||
| 123 | 129 | dpkg -l | grep -E 'deb7|wheezy' | grep -v xen | grep -v -E 'linux-image|mailscanner|openswan|debian-security-support' | awk '{print $2}' | xargs aptitude -y purge | |
| 124 | 130 | dpkg -l | grep -E 'deb8|jessie' | grep -v xen | grep -v -E 'linux-image|debian-security-support' | awk '{print $2}' | xargs aptitude -y purge | |
| 125 | 131 | aptitude -y install deborphan && deborphan | grep -v xen | grep -v libpam-cracklib | xargs aptitude -y purge | |
| 126 | - | dpkg -l | grep ^r | awk '{print $2}' | xargs aptitude -y purge | |
| 132 | + | apt-get purge $(dpkg -l | awk '/^rc/ { print $2 }') | |
| 127 | 133 | ||
| 128 | 134 | # for the brave YoloOps crowd | |
| 129 | 135 | reboot && sleep 180; echo u > /proc/sysrq-trigger ; sleep 2 ; echo s > /proc/sysrq-trigger ; sleep 2 ; echo b > /proc/sysrq-trigger | |
Jan Wagner ревизий этого фрагмента 8 years ago. К ревизии
1 file changed, 37 insertions, 86 deletions
jessie2stretch.sh
| @@ -1,27 +1,26 @@ | |||
| 1 | - | Please also refer to http://www.debian.org/releases/jessie/releasenotes and use your brain! | |
| 1 | + | Please also refer to http://www.debian.org/releases/stretch/releasenotes and use your brain! | |
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | - | # upgrade to UTF-8 locales (http://www.debian.org/releases/jessie/amd64/release-notes/ap-old-stuff.en.html#switch-utf8) | |
| 4 | + | # upgrade to UTF-8 locales (http://www.debian.org/releases/stretch/amd64/release-notes/ap-old-stuff.en.html#switch-utf8) | |
| 5 | 5 | dpkg-reconfigure locales | |
| 6 | 6 | ||
| 7 | 7 | # remove unused config file | |
| 8 | 8 | rm -rf /etc/network/options /etc/environment | |
| 9 | 9 | ||
| 10 | 10 | # Transition and remove entries from older releases | |
| 11 | - | sed -i s#/backports.org/debian#/ftp.de.debian.org/debian#g /etc/apt/sources.list* | |
| 12 | - | sed -i s/debian-backports/debian/g /etc/apt/sources.list* | |
| 13 | 11 | sed -i /etch/d /etc/apt/sources.list* | |
| 14 | 12 | sed -i /lenny/d /etc/apt/sources.list* | |
| 15 | 13 | sed -i /sarge/d /etc/apt/sources.list* | |
| 16 | 14 | sed -i /squeeze/d /etc/apt/sources.list* | |
| 15 | + | sed -i /wheezy/d /etc/apt/sources.list* | |
| 17 | 16 | sed -i /volatile/d /etc/apt/sources.list* | |
| 18 | 17 | sed -i /proposed-updates/d /etc/apt/sources.list* | |
| 19 | 18 | # change distro (please move 3rd party sources to /etc/apt/sources.list.d/), maybe look into http://ftp.cyconet.org/debian/sources.list.d/ | |
| 20 | - | sed -i s/wheezy/jessie/g /etc/apt/sources.list* | |
| 21 | - | sed -i "s/ stable/ jessie/g" /etc/apt/sources.list* | |
| 22 | - | sed -i s/wheezy/jessie/g /etc/apt/preferences* | |
| 23 | - | sed -i s/wheezy/jessie/g /etc/apt/sources.list.d/*wheezy* | |
| 24 | - | rename s/wheezy/jessie/g /etc/apt/sources.list.d/*wheezy* | |
| 19 | + | sed -i s/jessie/stretch/g /etc/apt/sources.list* | |
| 20 | + | sed -i "s/ stable/ stretch/g" /etc/apt/sources.list* | |
| 21 | + | sed -i s/jessie/stretch/g /etc/apt/preferences* | |
| 22 | + | sed -i s/jessie/stretch/g /etc/apt/sources.list.d/*jessie* | |
| 23 | + | rename s/jessie/stretch/g /etc/apt/sources.list.d/*jessie* | |
| 25 | 24 | aptitude update | |
| 26 | 25 | ||
| 27 | 26 | # check package status | |
| @@ -33,35 +32,30 @@ dpkg --get-selections | grep hold | |||
| 33 | 32 | aptitude unmarkauto vim | |
| 34 | 33 | aptitude unmarkauto monitoring-plugins-standard monitoring-plugins-common monitoring-plugins-basic | |
| 35 | 34 | aptitude unmarkauto open-vm-tools-dkms ifenslave | |
| 36 | - | aptitude unmarkauto $(dpkg-query -W 'linux-image-3.2.*' | cut -f1) | |
| 35 | + | aptitude unmarkauto $(dpkg-query -W 'linux-image-3.16*' | cut -f1) | |
| 37 | 36 | ||
| 38 | 37 | # have a look into required and free disk space | |
| 39 | 38 | apt-get -o APT::Get::Trivial-Only=true dist-upgrade || df -h | |
| 40 | 39 | ||
| 41 | 40 | # record session | |
| 42 | - | script -t 2>~/upgrade-jessie.time -a ~/upgrade-jessie.script | |
| 41 | + | script -t 2>~/upgrade-stretch.time -a ~/upgrade-stretch.script | |
| 43 | 42 | ||
| 44 | 43 | # install our preseed so libc doesn't whine | |
| 45 | - | cat > /tmp/jessie.preseed <<EOF | |
| 44 | + | cat > /tmp/stretch.preseed <<EOF | |
| 46 | 45 | libc6 glibc/upgrade boolean true | |
| 47 | 46 | libc6 glibc/restart-services string | |
| 48 | 47 | libc6 libraries/restart-without-asking boolean true | |
| 49 | 48 | EOF | |
| 50 | - | /usr/bin/debconf-set-selections /tmp/jessie.preseed | |
| 49 | + | /usr/bin/debconf-set-selections /tmp/stretch.preseed | |
| 51 | 50 | ||
| 52 | 51 | # update aptitude first | |
| 53 | 52 | [ "$(which aptitude)" = "/usr/bin/aptitude" ] && aptitude install aptitude | |
| 54 | 53 | ||
| 55 | - | # remove php5-suhosin, which doesn't exist in jessie anymore | |
| 56 | - | if [ "$( dpkg -l | grep "^ii.*php5-suhosin" | wc -l)" -ge "1" ]; then \ | |
| 57 | - | apt-get remove php5-suhosin | |
| 58 | - | fi | |
| 59 | - | # remove obsolete php5-ps | |
| 60 | - | if [ "$( dpkg -l | grep "^ii.*php5-ps" | wc -l)" -ge "1" ]; then \ | |
| 61 | - | apt-get remove php5-ps | |
| 62 | - | fi | |
| 54 | + | # migrate over to systemd | |
| 55 | + | aptitude install systemd | |
| 56 | + | ||
| 63 | 57 | # minimal system upgrade (keep sysvinit / see http://noone.org/talks/debian-ohne-systemd/debian-ohne-systemd-clt.html#%2811%29) | |
| 64 | - | aptitude upgrade '~U' 'sysvinit-core+' | |
| 58 | + | aptitude upgrade | |
| 65 | 59 | ||
| 66 | 60 | # (re)enable wheel | |
| 67 | 61 | if [ -f /etc/pam.d/su.dpkg-new ]; then CFG=/etc/pam.d/su.dpkg-new; else CFG=/etc/pam.d/su; fi | |
| @@ -77,9 +71,9 @@ sed -i "s/^ rocommunity public/# rocommunity public/" $CFG | |||
| 77 | 71 | sed -i "s/^ rocommunity6 public/# rocommunity6 public/" $CFG | |
| 78 | 72 | sed -i "s/agentAddress udp:127/#agentAddress udp:127/" $CFG | |
| 79 | 73 | ||
| 80 | - | # fix our xen modification | |
| 81 | - | rm -rf /etc/grub.d/09_linux_xen | |
| 82 | - | dpkg-divert --divert /etc/grub.d/09_linux_xen --rename /etc/grub.d/20_linux_xen | |
| 74 | + | ## fix our xen modification | |
| 75 | + | #rm -rf /etc/grub.d/09_linux_xen | |
| 76 | + | #dpkg-divert --divert /etc/grub.d/09_linux_xen --rename /etc/grub.d/20_linux_xen | |
| 83 | 77 | ||
| 84 | 78 | # chrony update | |
| 85 | 79 | if [ -f /etc/chrony/chrony.conf.new ]; then CFG=/etc/chrony/chrony.conf.new; else CFG=/etc/chrony/chrony.conf; fi | |
| @@ -90,79 +84,35 @@ if [ -f /etc/crontab.dpkg-new ]; then CFG=/etc/crontab.dpkg-new; else CFG=/etc/c | |||
| 90 | 84 | sed -i 's#root cd#root perl -e "sleep int(rand(300))" \&\& cd#' $CFG | |
| 91 | 85 | sed -i 's#root\ttest#root\tperl -e "sleep int(rand(3600))" \&\& test#' $CFG | |
| 92 | 86 | ||
| 93 | - | # phpmyadmin | |
| 94 | - | if [ -f /etc/phpmyadmin/config.inc.php.dpkg-new ]; then CFG=/etc/phpmyadmin/config.inc.php.dpkg-new; \ | |
| 95 | - | else CFG=/etc/phpmyadmin/config.inc.php; fi | |
| 96 | - | sed -i "s/\['auth_type'\] = 'cookie'/\['auth_type'\] = 'http'/" $CFG | |
| 97 | - | sed -i "s#//\$cfg\['Servers'\]\[\$i\]\['auth_type'\] = 'http';#\$cfg['Servers'][\$i]['auth_type'] = 'http';#" $CFG | |
| 87 | + | ## phpmyadmin | |
| 88 | + | #if [ -f /etc/phpmyadmin/config.inc.php.dpkg-new ]; then CFG=/etc/phpmyadmin/config.inc.php.dpkg-new; \ | |
| 89 | + | # else CFG=/etc/phpmyadmin/config.inc.php; fi | |
| 90 | + | #sed -i "s/\['auth_type'\] = 'cookie'/\['auth_type'\] = 'http'/" $CFG | |
| 91 | + | #sed -i "s#//\$cfg\['Servers'\]\[\$i\]\['auth_type'\] = 'http';#\$cfg['Servers'][\$i]['auth_type'] = 'http';#" $CFG | |
| 98 | 92 | ||
| 99 | 93 | # maybe we want to change some shorewall config stuff again | |
| 100 | - | sed -i s/^startup=0/startup=1/ /etc/default/shorewall | |
| 101 | - | # nat helper needs to be install (http://shorewall.net/Helpers.html#idp8854577312) | |
| 102 | - | ucf /usr/share/shorewall/configfiles/conntrack /etc/shorewall/conntrack | |
| 94 | + | # shorewall needs to be enabled via systemctl, /etc/default is not used by systemd | |
| 95 | + | systemctl enable shorewall | |
| 103 | 96 | ||
| 104 | 97 | # full-upgrade | |
| 105 | 98 | aptitude full-upgrade | |
| 106 | 99 | ||
| 107 | - | # Apache2 config migration | |
| 108 | - | # see also /usr/share/doc/apache2/NEWS.Debian.gz | |
| 109 | - | # | |
| 110 | - | # migrate sites into new naming scheme | |
| 111 | - | perl /usr/share/doc/apache2/migrate-sites.pl | |
| 112 | - | # migrate server config snippets into new directory | |
| 113 | - | cat > /tmp/a2confmigrate << EOF | |
| 114 | - | APACHE2BASEDIR="/etc/apache2"; for CONF in \$(ls -l \${APACHE2BASEDIR}/conf.d/ | grep -v ^l | awk '{print \$9}' | grep -v ^$); do | |
| 115 | - | if ! [ "\${CONF##*.}" == "conf" ]; then | |
| 116 | - | mv \${APACHE2BASEDIR}/conf.d/"\${CONF}" \${APACHE2BASEDIR}/conf.d/"\${CONF}".conf | |
| 117 | - | CONF="\${CONF}.conf" | |
| 118 | - | fi | |
| 119 | - | mv \${APACHE2BASEDIR}/conf.d/"\${CONF}" \${APACHE2BASEDIR}/conf-available/"\${CONF}" | |
| 120 | - | # enable this | |
| 121 | - | CONF=\$(basename "\${CONF}" .conf) | |
| 122 | - | a2enconf "\${CONF}" | |
| 123 | - | done | |
| 124 | - | EOF | |
| 125 | - | sh /tmp/a2confmigrate | |
| 126 | - | # migrate standard Options config to valid one | |
| 127 | - | sed -i "s/Options ExecCGI/Options +ExecCGI/" /etc/apache2/sites-available/* | |
| 128 | - | # fix probable Piped Logs | |
| 129 | - | sed -i 's/|exec /| /' /etc/apache2/sites-available/* | |
| 130 | - | # check for probably incompatible Apache configration statements (see https://gist.github.com/waja/86a3a055c1fedfba3c58#upstream-changes) | |
| 131 | - | # Even lists conditional statements which might be not a problem | |
| 132 | - | rgrep -iE "(Order|Allow|Deny|Satisfy) " /etc/apache2/conf-enabled/* | grep -v ":#" && rgrep -iE "(Order|Allow|Deny|Satisfy) " /etc/apache2/sites-enabled/* | grep -v ":#" | |
| 133 | - | # just in case you have you DocumentRoots in /var/www, you might want to also check for .htaccess containing those | |
| 134 | - | # Even lists conditional statements which might be not a problem | |
| 135 | - | rgrep -iE "(Order|Allow|Deny|Satisfy) " --include .htaccess /var/www/ | grep -v ":#" | |
| 136 | - | ||
| 137 | - | # serveral changes may be needed to adjust content of config files | |
| 138 | - | # see https://gist.github.com/waja/86a3a055c1fedfba3c58#file-apache2.0to2.4.md | |
| 139 | - | ||
| 140 | - | # migrate redmine plugins | |
| 141 | - | mv /usr/share/redmine/vendor/plugins/* /usr/share/redmine/plugins/ && rmdir /usr/share/redmine/vendor/plugins/ | |
| 142 | - | # Remove inconsistent link in /usr/share/redmine/vendor/rails | |
| 143 | - | rm /usr/share/redmine/vendor/rails | |
| 144 | - | # migrate database config for mysql | |
| 145 | - | sed -i "s/adapter: mysql/adapter: mysql2/" /etc/redmine/default/database.yml | |
| 146 | - | ||
| 147 | - | # Fixing Typo bug in claav-daemon (http://bugs.debian.org/778507) | |
| 148 | - | sed -i "s/DEBCONFILE/DEBCONFFILE/" /var/lib/dpkg/info/clamav-daemon.postinst | |
| 149 | - | ||
| 150 | 100 | # Upgrade postgres | |
| 151 | - | if [ "$(dpkg -l | grep "postgresql-9.1" | awk {'print $2'})" = "postgresql-9.1" ]; then \ | |
| 152 | - | aptitude install postgresql-9.4 && \ | |
| 153 | - | pg_dropcluster --stop 9.4 main && \ | |
| 101 | + | if [ "$(dpkg -l | grep "postgresql-9.4" | awk {'print $2'})" = "postgresql-9.4" ]; then \ | |
| 102 | + | aptitude install postgresql-9.6 && \ | |
| 103 | + | pg_dropcluster --stop 9.6 main && \ | |
| 154 | 104 | /etc/init.d/postgresql stop && \ | |
| 155 | - | pg_upgradecluster -v 9.4 9.1 main && \ | |
| 156 | - | sed -i "s/^manual/auto/g" /etc/postgresql/9.4/main/start.conf && \ | |
| 157 | - | sed -i "s/^port = .*/port = 5432/" /etc/postgresql/9.4/main/postgresql.conf && \ | |
| 158 | - | sed -i "s/^shared_buffers = .*/shared_buffers = 128MB/" /etc/postgresql/9.4/main/postgresql.conf && \ | |
| 105 | + | pg_upgradecluster -v 9.6 9.4 main && \ | |
| 106 | + | sed -i "s/^manual/auto/g" /etc/postgresql/9.6/main/start.conf && \ | |
| 107 | + | sed -i "s/^port = .*/port = 5432/" /etc/postgresql/9.6/main/postgresql.conf && \ | |
| 108 | + | sed -i "s/^shared_buffers = .*/shared_buffers = 128MB/" /etc/postgresql/9.6/main/postgresql.conf && \ | |
| 159 | 109 | /etc/init.d/postgresql restart; \ | |
| 160 | 110 | fi | |
| 161 | - | pg_dropcluster 9.1 main | |
| 111 | + | pg_dropcluster 9.4 main | |
| 162 | 112 | ||
| 163 | 113 | # xen: use our own bridge script again, when we did before | |
| 164 | - | [ $(grep "^(vif-script vif-bridge-local" /etc/xen/xend-config.sxp | wc -l) -gt 0 ] && \ | |
| 165 | - | sed -i 's/#vif.default.script="vif-bridge"/vif.default.script="vif-bridge-local"/' /etc/xen/xl.conf | |
| 114 | + | #[ $(grep "^(vif-script vif-bridge-local" /etc/xen/xend-config.sxp | wc -l) -gt 0 ] && \ | |
| 115 | + | # sed -i 's/#vif.default.script="vif-bridge"/vif.default.script="vif-bridge-local"/' /etc/xen/xl.conf | |
| 166 | 116 | ||
| 167 | 117 | # remove old squeeze packages left around (keep eyes open!) | |
| 168 | 118 | apt-get autoremove | |
| @@ -171,6 +121,7 @@ dpkg -l | grep etch | grep -v xen | grep -v unbound | grep -v finch | awk '{prin | |||
| 171 | 121 | dpkg -l | grep lenny | grep -v xen | awk '{print $2}' | xargs aptitude -y purge | |
| 172 | 122 | dpkg -l | grep -E 'deb6|squeeze' | grep -v xen | awk '{print $2}' | xargs aptitude -y purge | |
| 173 | 123 | dpkg -l | grep -E 'deb7|wheezy' | grep -v xen | grep -v -E 'linux-image|mailscanner|openswan|debian-security-support' | awk '{print $2}' | xargs aptitude -y purge | |
| 124 | + | dpkg -l | grep -E 'deb8|jessie' | grep -v xen | grep -v -E 'linux-image|debian-security-support' | awk '{print $2}' | xargs aptitude -y purge | |
| 174 | 125 | aptitude -y install deborphan && deborphan | grep -v xen | grep -v libpam-cracklib | xargs aptitude -y purge | |
| 175 | 126 | dpkg -l | grep ^r | awk '{print $2}' | xargs aptitude -y purge | |
| 176 | 127 | ||
Jan Wagner ревизий этого фрагмента 8 years ago. К ревизии
3 files changed, 28 deletions
wheezy2jessie.sh переименован в jessie2stretch.sh
Файл переименован без изменений
x_fix_apache2.4_slash_docroot.sh (файл удалён)
| @@ -1,11 +0,0 @@ | |||
| 1 | - | # when <Directory > config is applied on / instead of DocumentRoot, we need to fix that | |
| 2 | - | cat > /tmp/a2conf_dir_migrate << EOF | |
| 3 | - | grep -i "<directory />" /etc/apache2/sites-enabled/* | |
| 4 | - | for HOST in \$(grep -i "<directory />" /etc/apache2/sites-enabled/* | grep -v 000-default | awk -F':' '{print \$1}' | sed "s/.conf//" | sed "s#^/etc/apache2/sites-enabled/##"); do | |
| 5 | - | DOCROOT=\$(grep DocumentRoot /etc/apache2/sites-enabled/\${HOST} | awk '{print \$2}'); | |
| 6 | - | sed -i "s#<Directory />#<Directory \${DOCROOT}>#" /etc/apache2/sites-available/\${HOST}; | |
| 7 | - | done | |
| 8 | - | echo -e "Migration done.\nRemaining problematic configurations, please investigate:" | |
| 9 | - | grep -i "<directory />" /etc/apache2/sites-enabled/* | |
| 10 | - | EOF | |
| 11 | - | sh /tmp/a2conf_dir_migrate | |
z_apache2.0to2.4.md (файл удалён)
| @@ -1,17 +0,0 @@ | |||
| 1 | - | # Migrating the Apache config files into new places and naming scheme | |
| 2 | - | ||
| 3 | - | see https://gist.github.com/waja/86a3a055c1fedfba3c58#file-wheezy2jessie-sh | |
| 4 | - | ||
| 5 | - | # Upstream changes | |
| 6 | - | ||
| 7 | - | * [Order](http://httpd.apache.org/docs/2.4/mod/mod_access_compat.html#order), [Allow](http://httpd.apache.org/docs/2.4/mod/mod_access_compat.html#allow), [Deny](http://httpd.apache.org/docs/2.4/mod/mod_access_compat.html#deny) and [Satisfy](http://httpd.apache.org/docs/2.4/mod/mod_access_compat.html#satisfy) are obsolete, you should read [Run-Time Configuration Changes](http://httpd.apache.org/docs/2.4/upgrading.html#run-time) or [Beyond just authorization](http://httpd.apache.org/docs/2.4/howto/auth.html#beyond) | |
| 8 | - | * Mixing [Options](http://httpd.apache.org/docs/current/mod/core.html#options) with a + or - with those without is not valid syntax, and will be rejected during server startup by the syntax check with an abort. | |
| 9 | - | * Certificate handleing has changed, obsoletes [SSLCertificateChainFile](http://httpd.apache.org/docs/current/mod/mod_ssl.html#sslcertificatechainfile), please use [SSLCertificateFile](http://httpd.apache.org/docs/current/mod/mod_ssl.html#sslcertificatefile), it may also include intermediate CA certificates, sorted from leaf to root now | |
| 10 | - | * Several other changes can be found in the [Upgrading to 2.4 from 2.2](http://httpd.apache.org/docs/2.4/upgrading.html) documentation | |
| 11 | - | ||
| 12 | - | ||
| 13 | - | # Some more other handy resources | |
| 14 | - | ||
| 15 | - | https://www.digitalocean.com/community/tutorials/migrating-your-apache-configuration-from-2-2-to-2-4-syntax | |
| 16 | - | https://www.linode.com/docs/security/upgrading/updating-virtual-host-settings-from-apache-2-2-to-apache-2-4 | |
| 17 | - | http://linoxide.com/linux-how-to/apache-migration-2-2-to-2-4-ubuntu-14-04/ | |