Archive for the ‘geek’ Category

Patch: Ubuntu DRBD now can haz run after boot

Tuesday, December 9th, 2008

Ubuntu server edition “brings the power of inexpensive shared storage to your servers”. In particular, they tout DRBD support. Unfortunately, in Ubuntu 8.10 Intrepid Ibex, DRBD won’t start at boot.

The bug wasn’t too hard to track down. The problem is the update-rc.d script (run in the package postinst) is parsing the LSB headers in the DRBD init.d script. The LSB headers tell update-rc.d to not include runlevel 2 (Ubuntu’s default) when installing symlinks, so none is made in rc2.d. Hence, the init script is not run during startup.

I put documentation and a debdiff (package patch) on the launchpad bug report. However, even though this package is in main, I have no faith this bug will be fixed by Ubuntu (see update below the fold). So, for your server’s enjoyment, grab the patched packages we are using at my company:

(more…)

Friday links: flash vorbis, appstore shackles, python 2.6

Friday, October 3rd, 2008

A few things I found particularly interesting this week:

Flash Vorbis player – An open source vorbis player in a 46KB SWF file!

Engadget Cares: save us from Apple’s groundbreaking, developer-shackling App Store

Python 2.6 – Finally released with a ton of 3.0 features and the new -3 switch. Should be fun.

NAT-PMP port mapper utility and framework

Tuesday, September 30th, 2008

Sometimes I want to make a port on my home network (airport and OS X laptop) accessible to the world. However, using airport utility to setup the mapping and restart the router is annoying, especially when I know you can just map the port with some UDP packets.

A little searching around revealed Port Map. It’s The Coding Monkey‘s very nice and simple GUI wrapped around their real project: a Cocoa interface for automatically port mapping. It uses the open source libraries libnatpmp and miniupnp and the framework itself is MIT licensed.

I’m always excited when I see OS X developers doing some open source work. That’s a huge part of the culture of Linux that is missing from the OS X developer consciousness. That you are legally barred from writing open source applications with the iPhone SDK is one of the many reasons the iTunes App Store is a nightmare for developers (and consequently, consumers).

Recovering an Ubuntu do-release-upgrade

Sunday, September 7th, 2008

This is a quick PSA for anyone who thinks they might be screwed if they lose their shell during do-release-upgrade: You aren’t. Just log back in and run dpkg --configure -a. You’ll finish configuring all the packages you didn’t get to before. Don’t forget to reboot to start using the new kernel. :-)

As a bonus, you can run aptitude to remove/purge any (now) obsolete packages.1

  1. Of course, this works best if you’ve been using aptitude all along and it has a good idea of what packages have been automatically installed.

Ubuntu 7.10 Gutsy → 8.04 Hardy upgrade freeze

Sunday, August 17th, 2008

Another Ubuntu upgrade, another critical upgrade bug. I had this idea that letting a solid chunk of time go by before upgrading (in this case, ~4 months) would mean most of the upgrade bugs would be gone. Instead, I was bit in the ass because using the current 7.10 Gutsy kernel (2.6.22-15) means the upgrade process will freeze on the locales package.

The workaround, found by siberoptik on the Ubuntu forums, is to reboot your system with the 2.6.22-14 kernel. Everything is peachy after that. Since I’m working remotely, the way I changed kernels was to edit /boot/grub/menu.lst and nuke the lines about the 2.6.22-15 kernel. That made 2.6.22-14 the top-most kernel. By the end of the upgrade none of those kernels will matter anymore anyway. If you are in front of the box, you can just press <Esc> at the grub menu.

If you find yourself in the middle of an upgrade, frozen at “Generating locales…”, all is not lost. Get another shell on the system, look for the process tree (`ps axfw`) with locale-gen running, and kill locale-gen off.1 For me, the upgrade continued on until the only packages left were ubuntu-minimal and locales. I had to kill off the locale-gen process a couple of more times until the upgrade process was declared “failed”.

At this point I reboot the box and something went awry as it didn’t come back again. :-o It’s unclear from the logs what exactly happened (working remotely, I couldn’t watch the screen), but after a hard reset I was able to get back in again. Running `dpkg --configure -a` had the locales generate instantly and everything was fine.

The total joke about all of this is, as usual, it’s not documented on Ubuntu’s site in any useful place. Yes, I found it in the forum after I hit the bug and knew what to search for, but it’s a bit late at that point. You’d think there would be a “caveats” or “known problems” or “big nasty critical bugs you should avoid” section on the help page about Hardy upgrades.

In an effort to prevent others from going down this road, I’ve put information in the following places:

Update (2008.08.19): The bug I filed against update-manager as been made a duplicate of a bug in linux-source-2.6.22. A lot of talk has been happening there and someone claims the developers are working on a fix.

Update (2008.09.24): On August 25, a new kernel was released which fixed this problem. All the upgrades I’ve done with the new kernel have gone perfectly. That said, it does appear there are some people who are still running into this problem. See barbex’s comment below and see the bug in linux-source-2.6.22 page.

  1. IMHO, it’s a good idea to try killing the highest process in the tree and work your way down to the root until you get the result you want.