Make command for re-enabling of exim and samhain slightly more robust
[mirror/dsa-wiki.git] / input / howto / upgrade-to-squeeze.mdwn
1
2 # Upgrade from lenny to squeeze
3
4 Make sure to coordinate with whoever uses the host, be it the buildd
5 operator, the QA team, the ftp team or just announce it if it's a
6 general developer box.
7
8 on buildds:
9
10         cd ~buildd
11         sudo su - buildd
12         touch NO-DAEMON-PLEASE EXIT-DAEMON-PLEASE && exit
13
14         now wait for the buildd to quit
15
16 turn off samhain
17
18         /etc/init.d/samhain stop &&
19         mv /etc/rc2.d/S19samhain /etc/rc2.d/K19samhain # and stay down
20
21
22 maybe turn off exim
23
24         /etc/init.d/exim4 stop &&
25         mv /etc/rc2.d/S20exim4 /etc/rc2.d/K20exim4 # so it stays down
26
27
28 install deborphan, clean up
29
30         apt-get install deborphan dialog
31         orphaner
32         orphaner -n
33         orphaner -a
34         orphaner -a -n
35
36 unhold puppet
37
38         echo puppet install | dpkg --set-selections &&
39         echo puppet-common install | dpkg --set-selections
40
41 purge removed packages
42
43         dpkg --get-selections | awk '$2=="deinstall" {print $1}' &&
44         echo "really purge these [y/N]?" && read ans && [ "$ans" = "y" ] && dpkg --purge `dpkg --get-selections | awk '$2=="deinstall" {print $1}'` &&
45         echo "These are not at install:" && dpkg --get-selections | awk '$2!="install" {print $1}'
46
47 change sources list entries to squeeze:
48
49         cd /etc/apt/sources.list.d && sed -i "s#lenny#squeeze#g" debian.list
50
51 update apt list
52
53         apt-get update
54
55 upgrade
56
57         apt-get install locales-all apt dpkg
58
59 rest follows
60
61         apt-get dist-upgrade
62
63 use dash as system shell (/bin/sh).
64
65 reject changes to /etc/pam.d/sudo (puppet will install a new file later anyway)
66
67 reject changes to /etc/munin/plugin-conf.d/munin-node (puppet will install a new file later anyway)
68
69  * keep local (i.e. reject (N)):
70   * all changes relating to exim  (in /etc/exim4 and in logrotate)
71   * /etc/ldap/ldap.conf
72   * /etc/nagios/nrpe.cfg
73   * /etc/samhain/samhainrc
74   * /etc/munin/munin-node.conf
75   * /etc/logrotate.d/apache2
76   * /etc/apache2/apache2.conf
77   * /etc/apache2/ports.conf
78
79 update dsa-nagios.git (add host to squeeze hostgroup)
80
81 update dsa-puppet.git (add to squeeze list in local.yaml)
82
83 do a puppet run:
84
85         puppetd -t; puppetd -t
86
87 upgrade once more (security etc)
88
89         apt-get update && apt-get dist-upgrade
90
91 if you are moving from a dsa kernel to a debian kernel, add non-free to sources list, then
92
93         apt-get install firmware-linux
94
95 maybe also
96
97         apt-get install firmware-bnx2
98
99 if you are an nfs client, make sure to load the module before boot completes:
100
101         echo nfs >> /etc/modules
102
103 if you are an autofs node, make sure to load the module before boot completes:
104
105         echo autofs4 >> /etc/modules
106
107 These last two are because autofs in particular lazy loads the modules, and it
108 will happen after we've disabled module loading.
109
110 clean up transitions
111
112         dpkg --purge dhcp3-client && apt-get install isc-dhcp-client  # mark as non-auto
113
114 Do the same for grub/grub-pc if you did upgrade-from-grub-legacy
115
116         (reboot)
117         upgrade-from-grub-legacy
118         (reboot)
119         apt-get purge grub &&
120         apt-get install grub-pc
121
122 clean up old libs
123
124         orphaner
125         orphaner -n
126         orphaner -a
127         orphaner -a -n
128
129 check for unneeded/obsolete packages
130
131         apt-get autoremove
132
133         /usr/lib/nagios/plugins/dsa-check-packages
134
135 purge removed packages
136
137         dpkg --get-selections | awk '$2=="deinstall" {print $1}' &&
138         echo "really purge these [y/N]?" && read ans && [ "$ans" = "y" ] && dpkg --purge `dpkg --get-selections | awk '$2=="deinstall" {print $1}'` &&
139         echo "These are not at install:" && dpkg --get-selections | awk '$2!="install" {print $1}'
140
141 purge cruft that upgrade doesn't remove
142
143         apt-get remove --purge emacs22-common libxmlrpc-ruby libcap1 emacs22-nox emacs22-bin-common libvolume-id0 gcc-4.2-base ifenslave libopenssl-ruby1.8
144
145 re-init samhain
146
147 possibly reboot
148
149 re-enable exim, samhain
150
151         mv /etc/rc2.d/K??exim4 /etc/rc2.d/S02exim4
152         mv /etc/rc2.d/K??samhain /etc/rc2.d/S02samhain
153         env -i /etc/init.d/exim4 start
154         env -i /etc/init.d/samhain start
155
156         insserv
157
158 re-init samhain
159
160 ### Troubleshooting
161
162 ### Problems with CCISS
163
164 On custom kernels in squeeze it seems that udev stopped to create cciss devices, thus in /lib/udev/devices do a /dev/MAKEDEV cciss and reboot.
165
166         cd /lib/udev/devices
167         /dev/MAKEDEV cciss
168
169 ### mailq plugin no longer works
170         apt-get install nagios-plugins-standard