An assortment of indigestible things

Month: October 2012

Cotswold District Council’s finances laid bare

A couple of weeks ago (when I was supposed to be revising), I added some code to Armchair Auditor, a great bit of free software by Adrian Short. He wrote it to ingest spending data from Windsor and Maidenhead and present it to the public in a form that’s easily used for analysis and general poking around.

Recently, Cotswold District Council announced that it would start including all payments to suppliers without a lower limit (previously this limit was £500). My addition to Armchair Auditor allows for the processing of CDC’s spending data (with all its formatting idiosyncrasies) so that it can be presented in as useful a way.

I’m no data analyst, but perhaps there are interesting things to be found in the data. Have a look at the Cotswold District Council Armchair Auditor, and see what you can find—and please do leave a comment if anything interesting turns up!

Getting rid of automounts that won’t go away

If you delete an automount from a map and restart the daemon, the mountpoint should go away… but sometimes it doesn’t, and you end up with this:

drwxr-xr-x 2 root root 0 Oct 22 11:24 /wibble

The size of zero indicates that the system still sees a mountpoint here, and in /proc/mounts you’ll see something like

/etc/auto.mymap /wibble autofs rw,relatime,fd=5,pgrp=31311,timeout=86400,minproto=5,maxproto=5,direct 0 0

So the mountpoint is both there and not there, and any attempt to access it will hang. Trying to unmount it manually doesn’t work either. This can cause merry hell: on a default system, the updatedb process that locate uses will hang forever when it reaches the mountpoint (even though it’s configured to ignore nfs and autofs), and the rest of cron.daily will never be reached, so no log rotation for you. After a few days you’ll see lots of find processes cluttering up the place.

A reboot will fix it of course, but there is a much simpler and less destructive way:

umount -l /wibble

The ‘-l’ option is described in the manpage as

Lazy unmount. Detach the filesystem from the filesystem hierarchy now, and cleanup all references to the filesystem as soon as it is not busy anymore. (Requires kernel 2.4.11 or later.)

That suggests a reboot might be warranted at some point to make sure it’s completely gone away, but it certainly does the trick. The entry in /proc/mounts disappears, and the directory now looks like

drwxr-xr-x 7 root root 4096 Oct 22 11:40 /wibble

A much healthier-looking directory, which you can now safely delete. Don’t forget to kill all those backlogged jobs too.

Powered by WordPress & Theme by Anders Norén