Craig Box's journeys, stories and notes...


Using udev to set network card order

July 14th, 2006

Don't you hate it when you update a Linux machine, and the order that the network cards are detected, changes?

Code:

ifconfig | grep HWaddr | awk ' { printf"KERNEL==\"eth*\",SYSFS{address}==\"%s\", NAME=\"%s\"\n", $5, $1; }' > /etc/udev/rules.d/10-network-cards.rules

The cables don't change around, so neither should the order in which they come up.

lvm2 pre-installation script returned exit status 10

July 7th, 2006

Tracking down bugs in Debian and Ubuntu packages is fun for the whole family. Found this one while upgrading from Hoary to Dapper on a test box:

root@unassigned-firewall:~ # apt-get install lvm2..
Preparing to replace lvm2 2.00.32-1 (using .../lvm2_2.02.02-1ubuntu1_i386.deb) ...
dpkg: error processing /cdrom//pool/main/l/lvm2/lvm2_2.02.02-1ubuntu1_i386.deb (--unpack): subprocess pre-installation script returned error exit status 10
Errors were encountered while processing:
/cdrom//pool/main/l/lvm2/lvm2_2.02.02-1ubuntu1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Straight to Google. Nothing for this package, but some other packages with a similar error are reported. Eventually, I find a similar example, and work through the steps:

root@unassigned-firewall:~ # export DEBCONF_DEBUG=developer
root@unassigned-firewall:~ # apt-get install lvm2
..
Preparing to replace lvm2 2.00.32-1 (using .../lvm2_2.02.02-1ubuntu1_i386.deb) ...
debconf (developer): frontend started
debconf (developer): frontend running, package name is lvm2
debconf (developer): starting /var/lib/dpkg/tmp.ci/preinst upgrade 2.00.32-1
debconf (developer): <-- VERSION 2.0
debconf (developer): --> 0 2.0
debconf (developer): <-- CAPB backup
debconf (developer): --> 0 multiselect escape backup
debconf (developer): <-- TITLE LVM2
debconf (developer): --> 0
debconf (developer): <-- FSET lvm2/kernel seen false
debconf (developer): --> 10 lvm2/kernel doesn't exist
dpkg: error processing /cdrom//pool/main/l/lvm2/lvm2_2.02.02-1ubuntu1_i386.deb (--unpack):
subprocess pre-installation script returned error exit status 10
debconf (developer): frontend started
debconf (developer): frontend running, package name is lvm2
debconf (developer): starting /var/lib/dpkg/info/lvm2.postinst abort-upgrade 2.02.02-1ubuntu1
Errors were encountered while processing:
/cdrom//pool/main/l/lvm2/lvm2_2.02.02-1ubuntu1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Aha! Eventually, the problem presents itself, in the postinst - but of the new package, not the one that is in /var/lib/dpkg/info:

if ! dpkg --compare-versions $(uname -r) ge '2.6.12'; then
db_fset lvm2/kernel seen false
db_input critical lvm2/kernel || true
db_go
exit 1
fi

Which neatly matches this Debian bug. I built me a package without this block (you're going to be running a new kernel when the upgrade that includes this package is done - the new version wouldn't cleanly backport), and the upgrade continued.

The moral of this story is I should have gone to Launchpad first, as the bug is recorded there. Google just didn't see it.

Craig's Way

July 6th, 2006

Open letters seem to be all the rage these days. How about we just go with "Craig, as benevolent dictator, says How It Is":

Microsoft are hereby instructed to publish Open Office XML as a royalty and patent free open standard. Everyone else is hereby instructed to change to use it (they can call it OpenDocument 2.0 if required), and then people won't have to care about OpenOffice.org if they don't want, because the standard is standard.

Microsoft will then be forced to operate exactly to the published standard, publishing changes under the same license and arrangement if they wish to extend the standard (well before the release of their product), and maintaining backwards compatibility.

There, everyone wins. Why does it always take me deciding how it has to be, to get results like this?

Vote Quimby.

IE7 and WGA

July 3rd, 2006

Such beautiful praise from Paul Thurrott:

Internet Explorer 7.0 Beta 3 is a solid, feature-packed browser that all IE users should flock to immediately. While it's not enough to make me switch from Firefox yet--I still love certain Firefox features such as inline search--it's no longer an object of ridicule either.

What I do dislike, however:

validate.jpg

Is this happening with everything? Will WGA ever stop? (Well, yes, in that case. But you know they want to do it.)

The copy of Windows XP I'm using is the one that came preloaded with my laptop, but we deal a lot also in volume license versions for our customers (more Office than Windows, as there's little point in buying Windows twice, and we can't exactly buy PCs without it now, can we?) I don't appreciate being made to feel like a criminal every time I want to do anything.

Windows utilities you didn't know about: subinacl.exe

June 30th, 2006

subinacl is "a command-line tool that enables administrators to obtain security information about files, registry keys, and services, and transfer this information from user to user, from local or global group to group, and from domain to domain."

The magic thing that you can do with subinacl that you can't do with the GUI, is change ownership of files. It was a deliberate decision to only allow taking ownership from the GUI, so that if you are an admin, and someone locks you out of their files, and you have to take ownership to see them, the owner will know. Bugger having a paper trail for a laugh - use subinacl.

I have found a good example (with pics) at Windows Server Hacks. There is a reference page at ss64, which is a great reference for command line Windows tools. (What, Windows has a command line?)

If you're the sort of person who already knew about subinacl, can tell me tales of other useful tools like it, and want an IT job in Hamilton, we want to hear from you.

Rosebud

June 28th, 2006

SUSE Linux Enterprise Desktop (previously Novell Linux Desktop, now "SLED") has released a public preview of version 10. Along with this are some preview videos.

I like what they've done with the main application starter menu, but I also like what Gimmie is doing in this area. Check out Alex Graveley's Gimmie GUADEC slides for some idea of the direction that launch panels might be going. If it gets combined with MacSlow's Cairo dock, we could see some excellent GNOME app launch/management lovin'.

Also, Ubuntu fits snugly on one CD. Why does SLED need five? Can I make do with just one?

More random unfixed bugs: Big gray box on Java websites

June 26th, 2006

One of the reasons I wanted to start blogging was to draw attention to random bugs that I've found and either only worked around or not fixed.

Today's bug-that-I-hoped-was-fixed: in the Sun JVM on Windows XP, 1.5.0.06 (Update 6) or higher, if you try and go to a website that embeds Java, and get a big gray box instead of usefulness.

It is not fixed in 1.5.0.07. In fact, it is marked WONTFIX. It would be fixed if Java was open source software, or if Microsoft and Sun were still friendly, co-operating companies. Unfortunately, neither of these things are currently true. Apparently Microsoft will address it in a cumulative update, sometime, if they feel like it. (Maybe it will be fixed in WinFS? *sting*)

Resolution: downgrade to 1.5.0.05. And cry a little.

Plea to ICANN

June 26th, 2006

Something that the .NZ registry does, but I don't think that ICANN does, is take expired domain names and put them into a holding pool. That way, for a period after their expiry, they don't work, but they are marked "pending release", and only the original owner can pay to get it back - everyone else has to wait. This is excellent if you forgot to pay for your domain and it lapsed - the lack of DNS records will point it out, and you won't find someone has bought it out from underneath you.

In 2001, Neil Finn put up an ambitious multimedia website at nilfun.net; with a one year contract on his designer, it seems he also only got a one year registration on the name; it expired, someone else bought it, and now it's never going back to him at all. Neil moved to nilfun.com and (probably unrelated) lost interest in the project.

What's the alternative? Register names for 10 years? Thats obviously what Network Solutions wants you to do.

I'm not sure how to fix the problem; if the price of domain names was hitched up substantially (you can register a .com for a third to half the price of a .nz, so I'm thinking at least ten times), it would mean that anyone with just a joke or an idea wanting to make a name for itself would have to think twice, but the speculators wouldn't be quite so interested either. And because anyone can buy a domain name, everyone does, forcing people with unique names to register them just so no one else does. Just think; if Angelina hadn't snapped up all simple derivatives of Shiloh Jolie-Pitt's domain name, she might have had to resort to jolie-piloh-shitt.com.

I wish the internet had a benevolent dictator who could point at a domain name and say "you are not using that in the spirit of the Internet; I'm taking it away from you".

Happy 30th, Prof. Eric

June 24th, 2006

Software Freedom Day 2006

June 24th, 2006

Sfd-logo-06

WLUG have had two installfests in the last two years; between them and the Saturday Workshops that run once a month, it seems we need to do a bit of advertising before we'll have any new people that need Linux installation help in the Waikato. (That, and Linux has become substantially easier to install recently!)

With the growth of international Software Freedom Day, it seemed about time that WLUG ran an SFD event in Hamilton to drum up interest both in F/OSS and the group itself.

So, if you're in Hamilton, or will be on September 16, mark the day in your calendar, and if you're interested in helping out, sign your name on the planning page.

This is a new area for us, so any advice from people who have done it before is welcomed.