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