So I wasn’t pleased to find my postfix-dovecot installation dying on upgrade from 11.04 to 11.10. I couldn’t sent outgoing mail or receive inbound.
Fortunately I wasn’t an “early upgrader”… both issues were easy to find and fix.
Fixing inbound mail
Messages sent to my address were being returned as undeliverable with the following error:
< my-server.com #5.3.0 x-unix; /usr/lib/dovecot/deliver: invalid option -- 'n' Usage: dovecot-lda [-c
This is fairly self-explanatory: In the new version of Dovecot, the “n” option is no longer used. If you receive this error, type the following commands:
sudo postconf -e "mailbox_command = /usr/lib/dovecot/deliver -c /etc/dovecot/conf.d/01-mail-stack-delivery.conf -m \"\${EXTENSION}\""
sudo service postfix restart
Done.
Fixing outbound mail
My errors were caused by the SASL authentication server, saslauthd. A bug report is here.
The problem can be fixed by rolling back saslauthd packages to a previous version, then “sticking” them so that they don’t get updated with regular system updates. Keep track of this so that you can remember to un-stick them when it comes time to upgrade.
First get the old packages. Replace “i386″ in the links below with “amd64″ if your server is 64-bit
mkdir ~/saslfixes
cd ~/saslfixes
wget http://archive.ubuntu.com/ubuntu/pool/main/c/cyrus-sasl2/libsasl2-2_2.1.23.dfsg1-5ubuntu3_i386.deb http://archive.ubuntu.com/ubuntu/pool/main/c/cyrus-sasl2/libsasl2-modules_2.1.23.dfsg1-5ubuntu3_i386.deb http://archive.ubuntu.com/ubuntu/pool/main/c/cyrus-sasl2/libsasl2-dev_2.1.23.dfsg1-5ubuntu3_i386.deb http://archive.ubuntu.com/ubuntu/pool/main/c/cyrus-sasl2/libsasl2-modules-sql_2.1.23.dfsg1-5ubuntu3_i386.deb http://archive.ubuntu.com/ubuntu/pool/main/c/cyrus-sasl2/sasl2-bin_2.1.23.dfsg1-5ubuntu3_i386.deb
Then remove the old packages and install the new ones:
sudo /etc/init.d/saslauthd stop
sudo dpkg -r libsasl2-dev
sudo dpkg -r libsasl2-modules-sql
sudo dpkg -r sasl2-bin
sudo dpkg -r --force-all libsasl2-2 libsasl2-2:i386
sudo dpkg -r --force-all libsasl2-modules
sudo dpkg -i --force-all *.deb
Then restart the servers:
sudo /etc/init.d/saslauthd restart
sudo /etc/init.d/postfix restart
And finally “stick” the packages so they aren’t updated:
Type these commands as root (sudo su - will get you a root shell)
echo libsasl2-dev hold | dpkg --set-selections
echo libsasl2-modules-sql hold | dpkg --set-selections
echo libsasl2-2 hold | dpkg --set-selections
echo libsasl2-modules hold | dpkg --set-selections
echo sasl2-bin hold | dpkg --set-selections
This is now much easier than it used to be. Last time I tried to set up a VPN on an Ubuntu server, I had trouble with reconnections and had to manually compile OpenSwan. These all seem to be fixed.
Instructions are already all over the internet, but there are a few extra steps for a default Ubuntu linode in order to get routing to work.
These instructions are tested with Ubuntu 11.04 (Natty), but should also work on 11.10. We will set up an OpenSwan IPSec server with l2tp encryption provided by xl2tpd.
sudo apt-get install openswan ppp xl2tpd
When editing the /etc/xl2tpd/xl2tpd.conf file, you can choose any private subnet for “IP Range” and “local IP”. The “Local IP” will be assigned to the server, and clients will be assigned IPs from the “IP Range”. For example, I chose 192.168.0.2 - 192.168.0.20 for the range and 192.168.0.1 for the local IP.
In addition, in the /etc/ppp/options.xl2tpd file, change the ms-dns line to point to your DNS name servers. You will probably want to use those provided by Linode too — you can add multiple ms-dns lines, one for each resolver.
exit 0; line. Change the 192.168.0.0/24 IP range to match the IP range you chose above in the xl2tpd.conf file.
iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -s 192.168.0.0/24 -j ACCEPT
iptables -A FORWARD -j REJECT
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
for each in /proc/sys/net/ipv4/conf/*
do
echo 0 > $each/accept_redirects
echo 0 > $each/send_redirects
done
/etc/init.d/ipsec restart
sudo /etc/rc.local.
sudo /etc/init.d/pppd-dns restart
sudo /etc/init.d/xl2tpd restart
sudo /etc/init.d/ipsec restart
sudo ipsec verify
I wanted to share my Apple bluetooth keyboard between my Mac mini and my desktop computer (running Ubuntu, but this would work with Windows).
First step was to get a USB bluetooth dongle and plug that into the KVM. Any USB dongle should do. When the KVM is switched to the Mac, the bluetooth dongle takes preference over the built-in Mac bluetooth receiver.
This works to share the keyboard, but the keyboard had to be disconnected and re-paired each time the KVM was switched — this is particularly problematic if you need to repair the keyboard at, for example, the login screen. It also requires you to enter a PIN code each time.
Fortunately this can be easily solved by sharing the generated link key between the two computers:
sudo defaults read /private/var/root/Library/Preferences/blued.plist. You will see something like the following:
{
LinkKeys = {
"00-aa-bb-cc-dd-ee" = {
"00-00-00-aa-aa-aa" = <81a83517 cc3c7afc fb8e99fc 5147fbf4>;
};
};
}
Here, the first code is the address of the bluetooth dongle. The second is the address of the keyboard, and the final, longer code is the link key.
To change the link key in Windows, you need to edit the registry — I didn’t do this, but a search for “Windows bluetooth link key registry” should give the goods.
Provided the keyboard doesn’t become unpaired, the setup should last indefinitely.
]]>There’s not a great deal to write about compatibility, as everything “just worked” out of the box.
The upgrade went well — one of the great things about Linux is how well it takes to a complete brain transplant. No HAL trouble or “repair install” nonsense that you get on Windows.
Here are the things I had to do after the upgrade to get a 100% perfect system…
Digital surround
I use a digital coax conneciton to my AV receiver. This worked right out of the box, with the digital stereo option chosen in volume control -> Sound Preferences -> hardware. However, I was only getting stereo rather than 5-channel sound. To fix this, open: /etc/modprobe.d/alsa-base and add:
options snd-hda-intel model=6stack-dig to the end, then restart.
Suspend/Resume
With S3 (Suspend to RAM/STR) enabled in BIOS, I still couldn’t get the system to sleep properly. As it turns out, the problem is due to the USB3 driver. I fixed this with a script that unloaded and reloaded the driver on suspend/resume. Follow these instructions on the Ubuntu Forums for creating this script.
With this change it seems I can pretty much suspend and resume all day, without any ill effects.
The icing on the cake was resuming from suspend with my USB keyboard. By default no USB devices will wake the system — you have to use the power button. To fix this, you first need to find out which bus your USB device is running on. Type lsusb, find your device, and note the bus number.
If, for example, your USB keyboard is running on Bus 5, then you’d use the following command to enable resume:
echo "USB5" > /proc/acpi/wakeup
Add that command to your /etc/rc.local file, before the final “exit 0;”, then log out and in again.
Other than updating my /etc/network/interfaces with a new ethX device (since I use manually-configured static networking), that’s pretty much all I had to do to complete the brain transplant.
]]>However, it all came to naught — VMWare fail. Miserably. Why? Because I can’t download the thing.
VirtualBox provides nice direct download links, and — even better — an Ubuntu repository.
What about WMWare? They provide… this:
Problem solved — there’s no way I want to hand over this kind of data. Sure, I could just fill in nonsense data (and I started to)… but then what happens when I need an update, or even upgrade to a paid version? VMWare: What the hell are you thinking, asking for all this personal information? The bounce rate for your software must be hideous — what a great way to send people to your competitors.
If you’re here because you’re searching for a “direct link to VMWare Player” in Google: Sorry, try this, much better link, instead.
]]>On Ubuntu, I’ve stuck with gedit, with several plugins, including the Symbol Browser from Micah Carrick. I tried, at various times, jEdit, gPhpEdit, and even Eclipse — but they all just ‘got in my way’ too much. gPhpEdit came close, but I found the function list wasn’t always accurate.
However, three things prompted me to look elsewhere again: First, it was choking on some sql dumps I was editing; Second, the symbol browser stopped working in Karmic; and Third, I still hate the shortcuts. I still prefer ctrl-Y for “redo” rather than “ctrl-shift-Z”, and I really, really need a shortcut (ctrl-D) for “duplicate this line”.
So, I just came across Geany — it’s great. It’s fast, configurable, stable, has a great symbol browser, has the shortcuts just right, and doesn’t get in my way.
It seems that Geany’s been around for a while — and is even part of the standard image on some lightweight linux distros. But this is the first time I’ve come across it — and I’m glad I did.
]]>Squeezeplay is the Squeezebox controller / squeezebox touch user interface, and it can run on any computer. You can use that computer as a controller for your squeezebox receiver, or as a complete squeezebox, playing music. If you can get it running on a portable device, you effectively get a new Squeezebox Controller for free.
Unfortunately, even though the Squeezeboxes are based on a GNU/Linux foundation, Linux users don’t get much love when it comes to releases of SqueezePlay… so we have to compile it ourselves.
Here is how to get SqueezePlay working on Ubuntu karmic amd64, but the instructions should apply to other distros. I’ve also tested it on Karmic 32 bit.
In order to run SqueezePlay, we need to compile the latest development code for SqueezePlay 7.5 that Logitech have available online on their SVN server. This guide is correct as at 21 Nov 2009, but as the Logitech devs work on the code, things will change, and they might introduce new bugs. For now, this is the procedure — and it works nicely with my SqueezeCentre 7.4.1.
First of all, we need to install the required dependencies. This may not be a complete list, as I may have had things installed already — if you get errors with ld towards the end of the process, you may be missing some.
Install the below packages with the following command in a terminal:
sudo apt-get install build-essential flex bison subversion automake libtool libpng12-dev libjpeg62-dev libexpat1-dev libreadline5-dev xorg-dev libflac++-dev libvorbis-dev libvorbisidec-dev libasound-dev
Next, we need to grab the SVN source code. Create a directory somewhere, open a terminal, and cd into the directory. Then do:
svn co http://svn.slimdevices.com/repos/jive/7.5/trunk/squeezeplay
Wait while the source is downloaded.
Now, we need to fix a couple of bugs to ensure it compiles smoothly. I’ve reported these to the dev team, so if you can’t find the parts to change — or it looks like they are fixed already, then don’t worry
The first two bugs are in <your-folder>/squeezeplay/src/Makefile.linux, so open up the file in a text editor, and make the following changes:
${PWD} to $(shell pwd) . After the change, line 10 will look thus:SRC_DIR = $(realpath $(shell pwd)) .cd luaprofiler-2.0 && make -f Makefile.linux install to: cd luaprofiler-2.0 && LD="gcc -shared" make -f Makefile.linux installThe third bug: browse to <your-folder>/squeezeplay/src/squeezeplay/src/audio/decode, and open decode.c. Find the printf statement on line 434, and change %llu to %"PRIu64". After this, line 434 will look like this:
printf("elapsed:%"PRIu64" buffers: %0.1f%%/%0.1f%%\n", elapsed, dbuf, obuf);
Finally, we need to replace one of the static libraries that squeezeplay is using — the version of portaudio that is included is out of date, and prevents sound from playing. So, download the latest portaudio here, put it in your squeezeplay/src directory, and double-click it to extract it there. Then rename Logitech’s portaudio_v19_1360 directory to portaudio_v19_1360-old, and rename your new portaudio directory to portaudio_v19_1360.
Now, it’s time to compile the code. Switch to the <your-folder>squeezeplay/src directory in your terminal (e.g. cd squeezeplay/src), and run the compile as follows:
sudo make -f Makefile.linux
This will take a while. Once done, you will have a tarball in the ../build directory. To install squeezeplay, you just need to extract the contents of this to /opt/squeezeplay:
cd ../build/
sudo mkdir /opt/squeezeplay
tar -C /opt/squeezeplay -xvf sq<TAB>
(the exact name of the squeezeplay tarball will vary — just hit tab to have it auto-complete).
then, to start squeezeplay, the command is:
/opt/squeezeplay/bin/squeezeplay.sh
to uninstall, just delete it from /opt.
Some potential hiccups:
My next step is to get it running on an old iPaq PDA I have lying around… watch this space!
]]>Like most people, at first, I thought this was a bug. The short answer is — it isn’t. The devs, in their infinite wisdom, think its better this way — the “top slot” for notifications is reserved for synchronous notifications, such as brightness and volume.
Again, like most people, I completely disagree with the change — I think notifications hovering in the upper third of my screen are annoying, get in my way, and look sloppy. If they are worried about synchronous notifications moving around, they should centre them on the screen, like on a Mac — not move everything else around.
Anyway, Julien Lavergne has cooked up a quick patch for notify-osd that reverts back to the old behaviour. What’s more, he’s compiled notify-osd with the patch incorporated, so we can automatically use it.
To make use of his patch, and have it automatically kept up-to-date, you’ll need to add a new software source. You can do that with this one-liner in a terminal: sudo add-apt-repository ppa:gilir/updates
Then do an update through Update Manager, or through sudo apt-get update && sudo apt-get upgrade.
And — there you go:
]]>
If you do a fresh install of Karmic, everything will work just fine out of the box on the 1005HA. However, a fresh install is complete overkill. As always with Ubuntu — and with most Linux distributions in general — upgrading is easy. Few clicks in the package manager, and away you go.
However, if you followed my guide to installing Jaunty, you’ll have a few old packages kicking around that will cause a few idiosyncrasies. Immediately after the upgrade, I found that wireless was less reliable, particularly after suspend/resume. Also, I found that suspend was not reliable.
The solution is easy: you need to remove some of the things you installed.
You can remove these using Synaptic, or by doing apt-get remove <packagename1> <packagename2> <packagename3> .....
Remove the following:
After doing this, restart and make sure all your packages are up to date (use update manager or do sudo apt-get update && sudo apt-get upgrade.
Then, as the last step, you need to remove all the unneeded packages that were pulled in as dependencies previously. Easy — in a terminal, just type sudo apt-get autoremove. It’ll ask you to confirm, and you should see packages such as dkms being removed.
Finally, restart, and you should be all set