Backporting varnish from debian unstable/testing to etch

Recently i wanted to upgrade Varnish to latest stable – 2.0.4 on our debian etch boxes. Do you think debian has the latest version in the etch repos? Ofcourse not.. However, backporting turned out to be allmost too easy :) Here is how I did it;

1. Edit your /etc/apt/sources.list deb-src entry to reflect which debian version you want to backport packages from. My entry looks like this:
deb-src http://ftp.no.debian.org/debian/ unstable main non-free contrib
2. Download the source code from the repo:
apt-get source varnish
3. Make sure you have all the deps needed:
apt-get build-dep varnish
4. (might not be necessary) I was missing the fakeroot package:
apt-get install fakeroot
5. Build the package(s):
cd varnish-2.0.4
dpkg-buildpackage -rfakeroot -uc -b

6. And finally install your newly created packages:
cd ..
dpkg -i *.deb

Reference(s):
http://www.debian.org/doc/manuals/apt-howto/ch-sourcehandling.en.html

Tags: , , , , , ,

Distupgrading debian etch to lenny, and upgrading postgres 8.1 to 8.3

Pretty straight forward.
Edit your /etc/apt/sources.list. Substitute “etch” with “lenny”.

apt-get update
apt-get dist-upgrade

This will upgrade the system to lenny. Verify with
cat /etc/debian_version

The upgrade will not upgrade postgres. You need to do this manually.
apt-get install postgresql
8.3 will now be installed and configured to run on another port. 8.1 will still remain on your system, and you need to manually migrate your 8.1 bases to 8.3. Thankfully they provide some scripts for this.Here’s how you do it.
First drop the automatically created cluster for 8.3

g_dropcluster --stop 8.3 main

then upgrade the 8.1 cluster to 8.3

pg_upgradecluster -v 8.3 8.1 main

This should change the 8.1 config to run on another port while 8.3 should be running on default.
Prolly smart to stop 8.1, start 8.3 and verify that you’re databases are working as they should ..before you go ahead and remove 8.1.

If you run into some locales+postgres trouble with lenny. You should check your /etc/locale.gen, make sure the correct locales arent commented out,
and run locale-gen/dpkg-reconfigure. Then you should be able to start 8.1 again.

Tags: , , , , ,

Making Debian Etch boot with UUID, not hardcoded blockdevicename

You got additional disk controllers in your server and the etch kernel is fucking up your devicenames from time to time.
Suddenly when you reboot the etch kernel decides to make /dev/sda become /dev/sdf etc.
Ubuntu has learned from this and they use UUID.
This is a unique ID the filesystem becomes, and when you boot, you really want to catch the right device for the root filesystem, or get a crappy Busybox shell.

This is how you implement it on Debian Etch (and possibly Lenny, if its not default there either):

fittafeis:~# /lib/udev/vol_id /dev/sda1
ID_FS_USAGE=filesystem
ID_FS_TYPE=ext3
ID_FS_VERSION=1.0
ID_FS_UUID=3abbdf59-4a9e-4be1-ac56-f474609e637c
ID_FS_LABEL=
ID_FS_LABEL_SAFE=

Now edit this line in /boot/grub/menu.lst:

From: # kopt=root=/dev/sda1 ro
To: # kopt=root=UUID=3abbdf59-4a9e-4be1-ac56-f474609e637c ro

Then run update-grub and it will update all your kernel entries using UUID :)

Tags: , , ,