So your mongrels are humming along happily and you have monit monitoring them with a definition like this:
check process mongrel_8010 with pidfile /path/to/current/log/mongrel.8010.pid
start program = "/usr/bin/mongrel_rails cluster::start -C /path/to/current/config/mongrel_cluster.yml --clean --only 8010"
stop program = "/usr/bin/mongrel_rails cluster::stop -C /path/to/current/config/mongrel_cluster.yml --clean --only 8010"
if failed host 127.0.0.1 port 8010
with timeout 10 seconds
then restart
if totalmem > 128 Mb then restart
if cpu is greater than 60% for 2 cycles then alert
if 3 restarts within 5 cycles then timeout
group mongrel
The start/stop commands work perfectly from the command line, but somehow not when monit’s calling them. Sure enough, you find this in the mongrel.8010.log file:
/usr/lib/ruby/gems/1.8/gems/rubyforge-1.0.3/lib/rubyforge.rb:15:in `expand_path': couldn't find HOME environment -- expanding `~' (ArgumentError)
The line in question is
HOME = ENV["HOME"] || ENV["HOMEPATH"] || File::expand_path("~")
Monit does not set a HOME environment variable, nor HOMEPATH.
The documentation for File::expand_path says:
Converts a pathname to an absolute pathname. Relative paths are referenced from the current working directory of the process unless dir_string is given, in which case it will be used as the starting point. The given pathname may start with a ``~’’, which expands to the process owner‘s home directory (the environment variable HOME must be set correctly). ``~user’’ expands to the named user‘s home directory.
Ouch. So if HOME is not set, File::expand_path(”~”) is guaranteed to fail. That’s a bug in the rubyforge gem I think.
I worked around this by setting ENV["HOME"] to a fallback value before the
require 'rubygems'
line in /usr/bin/mongrel_rails.
I filed a bug. It took me a while to figure out that the rubyforge gem is part of the codeforpeople project on rubyforge.
I wrote about Monticello, Minnesota and its fight with the local incumbent telco TDS last fall. At the time, TDS had its lawsuit against the city thrown out for lack of merit. No big surprise, since the gist of the suit was basically “they are going to compete with us, and they are going to offer better service for less money!”. TDS was considering an appeal to the Minnesota supreme court.
TDS did appeal in the end, and thankfully lost. This is a win for municipal internet rollouts all across the US. It will hopefully make those greedy telcos think twice about trying to stop municipalities from providing their constituents with proper internet access.
A TDS spokesman said the decision “endangers the appropriate relationship between municipalities and private enterprise”. Presumably he means the relationship where municipalities have to allow private telcos like TDS to charge citizens an arm and a leg for sub-par broadband service, because there is no competition. To which I say – good riddance!
Construction starts in 2 weeks, and the first customers should be hooked up sometime this fall.
This is a very confused filesystem. But check it out – df supports zettabytes!
# df -h Filesystem Size Used Avail Use% Mounted on /dev/md0 19G -64Z 22G 101% /
Surprisingly, the machine is up and runs just fine.
I got a G1 the other day, and have it upgraded to android 1.5 (cupcake). Turns out the bluetooth abilities of this phone are rather … limited, particularly compared to my trusty nokia E70:
G1:
$ sdptool browse 00:22:A5:XX:XX:XX
Browsing 00:22:A5:XX:XX:XX ...
Service Name: Audio Source
Service RecHandle: 0x10000
Service Class ID List:
"Audio Source" (0x110a)
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 25
"AVDTP" (0x0019)
uint16: 0x100
Profile Descriptor List:
"Advanced Audio" (0x110d)
Version: 0x0100
Service Name: AVRCP TG
Service RecHandle: 0x10001
Service Class ID List:
"AV Remote Target" (0x110c)
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 23
"AVCTP" (0x0017)
uint16: 0x100
Profile Descriptor List:
"AV Remote" (0x110e)
Version: 0x0100
Service Name: Voice Gateway
Service RecHandle: 0x10002
Service Class ID List:
"Headset Audio Gateway" (0x1112)
"Generic Audio" (0x1203)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 11
Profile Descriptor List:
"Headset" (0x1108)
Version: 0x0100
Service Name: Voice Gateway
Service RecHandle: 0x10003
Service Class ID List:
"Handsfree Audio Gateway" (0x111f)
"Generic Audio" (0x1203)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 10
Profile Descriptor List:
"Handsfree" (0x111e)
Version: 0x0105
Nokia E70:
$ sdptool browse 00:12:D1:XX:XX:XX
Browsing 00:12:D1:XX:XX:XX ...
Service Name: AVRCP Target
Service Description: Audio Video Remote Control
Service Provider: Symbian Software Ltd.
Service RecHandle: 0x10000
Service Class ID List:
"AV Remote" (0x110e)
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 23
"AVCTP" (0x0017)
uint16: 0x100
uint16: 0xf00
Service Name: Hands-Free Audio Gateway
Service RecHandle: 0x10001
Service Class ID List:
"Handsfree Audio Gateway" (0x111f)
"Generic Audio" (0x1203)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 28
Language Base Attr List:
code_ISO639: 0x454e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"Handsfree Audio Gateway" (0x111f)
Version: 0x0101
Service Name: Headset Audio Gateway
Service RecHandle: 0x10002
Service Class ID List:
"Headset Audio Gateway" (0x1112)
"Generic Audio" (0x1203)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 29
Language Base Attr List:
code_ISO639: 0x454e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"Headset" (0x1108)
Version: 0x0100
Service Name: SyncMLClient
Service RecHandle: 0x10003
Service Class ID List:
UUID 128: 00000002-0000-1000-8000-0002ee000002
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 10
"OBEX" (0x0008)
Language Base Attr List:
code_ISO639: 0x454e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"" (0x00000002-0000-1000-8000-0002ee000002)
Version: 0x0100
Service Name: OBEX File Transfer
Service RecHandle: 0x10004
Service Class ID List:
"OBEX File Transfer" (0x1106)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 11
"OBEX" (0x0008)
Language Base Attr List:
code_ISO639: 0x454e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"OBEX File Transfer" (0x1106)
Version: 0x0100
Service Name: Nokia OBEX PC Suite Services
Service RecHandle: 0x10005
Service Class ID List:
UUID 128: 00005005-0000-1000-8000-0002ee000001
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 12
"OBEX" (0x0008)
Language Base Attr List:
code_ISO639: 0x454e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"" (0x00005005-0000-1000-8000-0002ee000001)
Version: 0x0100
Service Name: SyncML DM Client
Service RecHandle: 0x10006
Service Class ID List:
UUID 128: 00000004-0000-1000-8000-0002ee000002
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 13
"OBEX" (0x0008)
Language Base Attr List:
code_ISO639: 0x454e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"" (0x00000004-0000-1000-8000-0002ee000002)
Version: 0x0100
Service Name: Nokia SyncML Server
Service RecHandle: 0x10007
Service Class ID List:
UUID 128: 00005601-0000-1000-8000-0002ee000001
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 14
"OBEX" (0x0008)
Language Base Attr List:
code_ISO639: 0x454e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"" (0x00005601-0000-1000-8000-0002ee000001)
Version: 0x0100
Service Name: SIM Access
Service RecHandle: 0x10008
Service Class ID List:
"SIM Access" (0x112d)
"Generic Telephony" (0x1204)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 8
Language Base Attr List:
code_ISO639: 0x454e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"SIM Access" (0x112d)
Version: 0x0101
Service Name: OBEX Object Push
Service RecHandle: 0x10009
Service Class ID List:
"OBEX Object Push" (0x1105)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 9
"OBEX" (0x0008)
Language Base Attr List:
code_ISO639: 0x454e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"OBEX Object Push" (0x1105)
Version: 0x0100
Service Name: Dial-Up Networking
Service RecHandle: 0x1000a
Service Class ID List:
"Dialup Networking" (0x1103)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 2
Language Base Attr List:
code_ISO639: 0x454e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"Dialup Networking" (0x1103)
Version: 0x0100
Service RecHandle: 0x1000b
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 1
Service Name: Imaging
Service RecHandle: 0x1000c
Service Class ID List:
"Imaging Responder" (0x111b)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 15
"OBEX" (0x0008)
Language Base Attr List:
code_ISO639: 0x454e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"Imaging" (0x111a)
Version: 0x0100
What I’m missing in particular is the dialup access. Sometimes I still need to dial into a remote modem for out of band system access… I wonder how hard it would be to add that bluetooth profile.
I like most other things about the G1. Keyboard + 3G data == awesome. Battery life is not going to be nearly as good as the E70, though…
Netcraft’s June 2009 Web Server Survey is very interesting. Check out the IIS line on this graph (red):

That sharp drop is a reduction from 29,049,223 (May) to 21,898,527 (June) active sites. Netcraft explains the drop like this:
A reduction in activity at Microsoft Live Spaces was responsible for the large drop in the number of Microsoft-IIS sites detected.
This makes me wonder exactly how many of those IIS-hosted active sites are actually run by Microsoft (or its partners). The fact that just one of Microsoft’s services was responsible for over 7 million “active sites” – or 25% of the total number of active sites detected as running IIS in May 2009 – makes me wonder how valid the IIS numbers are in the webserver survey. I think this suggests IIS use is far less prominent outside the Microsoft campus than the ‘active sites’ numbers indicate.
I have a monit config that tries to stop/start mongrel instances like this:
start program = "/usr/bin/mongrel_rails cluster::start -C path-to-mongrel_cluster.yml --clean --only PORT" stop program = "/usr/bin/mongrel_rails cluster::stop -C path-to-mongrel_cluster.yml --clean --only PORT"
I have the latest mongrel_cluster gem installed (1.0.5), and yet mongrel_rails kept throwing errors about –clean and –only:
invalid option: --clean for command 'cluster::start' invalid option: --only for command 'cluster::start'
Turns out I had an older mongrel_cluster gem installed as well:
$ sudo gem cleanup mongrel_cluster Cleaning up installed gems... :0:Warning: Gem::SourceIndex#search support for Regexp patterns is deprecated Attempting to uninstall mongrel_cluster-0.2.1 Successfully uninstalled mongrel_cluster-0.2.1 Clean Up Complete
After running gem cleanup, the mongrel_rails commands above started working.
This kind of code behaviour irks me – it’s not intuitive. It does not help that ‘gem list’ suggests that having multiple versions of a gem installed is not a problem – and it usually is not. I guess the mongrel_cluster gem is an exception. File this one under ‘good to know’…
This is mostly a reminder to myself. Here’s a way to check a domain’s DNS glue records. For example, for google:
dig +trace +nosearch +all +norecurse google.com
A quick update on some of the bugs reported in my previous post bugs, bugs, bugs: upgrading to jaunty jackalope.
The two most serious problems were atrocious Intel video performance, and ongoing sound issues. Thankfully, the Intel issues have been addressed. Specifically, a really nice Troubleshooting Intel Performance document by Bryce Harrington has appeared. It lays out what is happening (in short: major driver refactoring), why it is affecting performance on some hardware, and specifically what to check and how to work around speed issues.
I ended up going back to the xserver-xorg-video-intel-2.4 package which fixes my main issue – really slow workspace switches. Looks like kernel and X.org fixes have already made it to Karmic Koala, but I’m happy to use the older driver until Karmic is released.
As for tor, Jaunty packages are now available so to install tor, just add
deb http://mirror.noreply.org/pub/tor jaunty main deb-src http://mirror.noreply.org/pub/tor jaunty main
to your
/etc/apt/sources.list
and apt-get install tor.
Finally – there’s a better way to reload the sound modules:
alsa force-reload
All right folks, time to fess up. What’s your count?
$ wc ~/.ssh/known_hosts -l 1470
Obviously there are some old machines in there – this file goes back at least five years. There are some duplicates as well as there is one line per host/port/user combination. It’s annoying that I can’t weed out old entries easily, as ssh now encrypts the entries in known_hosts by default. Of course that is a very sensible thing to do from a security perspective, but it’s a shame from a statistics point of view.
bugs, bugs, bugs: upgrading to jaunty jackalope
2 Comments Published April 28th, 2009 in Free Software/Open Source.I upgraded my laptop to Jaunty Jackalope. Here’s the list of issues (and solutions) I’ve run into:
1. Tor is not packaged anymore, apparently there is no Ubuntu maintainer. Upstream provides Ubuntu packages, but they have no jaunty package yet. So, we need to build from the intrepid source package. Add
deb-src http://mirror.noreply.org/pub/tor intrepid main
to your /etc/apt/sources.list, and
apt-get update cd /usr/src apt-get build-dep tor apt-get source tor -b
2. Bug 270046: Apparmor *still* fights with cups-pdf. This one’s been around since the Hardy days. You’d think it would be fixed by now… Specifically, print jobs to the PDF printer will just vanish because apparmor does not allow cupsd to save them in ~/PDF. Solution: disable apparmor for cupsd:
apparmor_parser -R /etc/apparmor.d/usr.sbin.cupsd /etc/init.d/apparmor restart
3. Bug 339555: Intel video is really really really really slow. Case in point: workspace switching takes seconds. (Partial) fix: upgrade to a experimental 2.6.30rc3 kernel. Even with that kernel, video performance on this GM965/GL960 based system is still not what it should be. To be continued, no doubt.
4. Bug 334657: Subpixel/Lcd mode with VRGB/VBGR makes fonts on qt4 applications unreadable. Really, really unreadable. Fix: use experimental patched qt4-x11 packages.
5. Sound has been an issue on this laptop from day one. It’s a Dell inspiron 1420N that shipped with Ubuntu preinstalled, but at the time a special Dell-supplied kernel was necessary to get working sound. The sound hardware is
$ lspci -vnn 00:1b.0 Audio device [0403]: Intel Corporation 82801H (ICH8 Family) HD Audio Controller [8086:284b] (rev 02) Subsystem: Dell Device [1028:01f3] Flags: bus master, fast devsel, latency 0, IRQ 21 Memory at fe9fc000 (64-bit, non-prefetchable) [size=16K] Capabilities:Kernel driver in use: HDA Intel Kernel modules: snd-hda-intel $ aplay -l **** List of PLAYBACK Hardware Devices **** card 0: Intel [HDA Intel], device 0: STAC92xx Analog [STAC92xx Analog] Subdevices: 0/1 Subdevice #0: subdevice #0
First of all I had to add my user to the pulse-rt group – pulseaudio was complaining loudly about that in /var/log/syslog. That’s a Jaunty upgrade bug.
Secondly, for some reason I can not get sound to work until I unload the snd_hda_intel module and reload it. Sadly, that means closing all applications that are using the sound hardware – mpd, firefox, pidgin, the gnome volume control applet, etc. I don’t know what’s causing this, but I had the same problem on Intrepid after the last kernel upgrade. Again, to be continued.
![[Play OGG]](/blog/wp-content/themes/3k2redux-klein/images/play_ogg_small.png)


