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


Posts Tagged ‘ubuntu’

NetworkManager PPTP plugin: Checking out & building

Saturday, July 29th, 2006

A while ago I promised Anthony Mee that I'd try and build the latest version of his NetworkManger VPN plugin for Ubuntu, and a couple of weeks ago I realised I had no excuses not to start.

I was tripped up while trying to build it: libtool: link: cannot find the library `/usr/lib/libXrender.la' or unhandled argument `/usr/lib/libXrender.la'.

Two minutes on #ubuntu-motu, I was fixed up by slomo: I use the non-official XGL repository, which has a broken libcairo2-dev package: I needed to edit /usr/lib/libcairo.la and replace -L/usr/lib/libXrender.la with -lXrender. Seeing as the web didn't seem to know this fact, and I couldn't find anywhere on the WLUG wiki to put this, I thought I'd teach it here.

Slowly checked NetworkManager out of CVS.

Last weekend Perry gave me a crash course in building things with autotools, using 'cvs export' or 'make dist' to get distributable-ready code. With a bit of hacking around, we managed to get the plugin built.

Came across a big problem; the old plugin was "org.freedesktop.NetworkManager.pptp", and the new one is "org.freedesktop.NetworkManager.ppp_starter". Took a random guess to figure out that the old VPN plugin was stored in gconf, and this was what was crashing the VPN dialog. Perry opined that the barrier to entry to anything with DBus was going to be so much higher than simple Unix-like XML-readin' apps, and I hope he'll put his feelings in words soon. When I get back to that machine, I'll raise a bug.

I think I now have everything I need to know to build a Debian package. Shame the thing doesn't actually work or anything. Have added Tony to Jabber and will hope to make some progress soon.

WordPress, how hard is to get an editor which gives me a <code>, <tt> or other monospace-this-part button?

Codenamed

Monday, July 24th, 2006

A while ago I blogged about Falcon, the Ubuntu/Debian repository builder, and how I'd quintupled the bug count. What fun to upgrade today and chance upon the changelog...

Version Codename Date Released
1.4.0   2006-07-15
1.3.2   2006-07-10
1.2 The Craig Box release 2006-06-23
1.1   2006-06-21
1.0   2006-05-29

I guess I'm flattered 🙂

AWStats on Ubuntu

Friday, July 21st, 2006

AWStats is a "free powerful and featureful tool that generates advanced web, streaming, ftp or mail server statistics, graphically". It's commonly used for generating pretty logs of your Apache web server. (See the AWStats demo if you're unfamiliar and interested.)

I got it going with my Ubuntu virtual web hosting setup this morning, and wrote a page about AWStats, Apache 2 and Ubuntu or Debian on the WLUG wiki. Enjoy.

Audio on Ubuntu

Thursday, July 20th, 2006

Ian recently mentioned a new Skype beta for Linux, using ALSA. Did you know that ALSA has supported software mixing "out of the box" since 1.0.9rc2? This means everything from Ubuntu Breezy up did sound mixing, and you didn't even know it. That means if Linux can play sound to your sound card, it will automatically mix multiple sound inputs at once, in hardware if possible, on the CPU if not.

GNOME uses the Enlightened Sound Daemon (ESD) to provide its audio notifications. ESD is, amongst other things, a software mixer - before ALSA, it would take control of the sound device and applications would connect to ESD, which would mix the sound together. Since Breezy, Ubuntu has used ESD with an ALSA backend, meaning that sound mixing "just works" for any application using ESD or ALSA for sounds. The only leftover was applications that wanted to write directly to /dev/dsp device, which can only ever be used by one person at a time. Skype was the last application I could name that didn't talk to ALSA natively, and unfortunately it had issues operating with ESD's dsp emulator, esddsp.

ESD hasn't been maintained for some years, and is probably going to be replaced with the new PulseAudio, formerly known as PolypAudio, a program designed to be a drop in ESD replacement.

Then, of course, there is Gstreamer, which can loosely be compared to DirectX's DirectShow. gstreamer-properties (or Preferences -> Multimedia Systems Selector) lets you set gstreamer to output to ALSA. I assume it's the default in recent Ubuntu releases, so you can play as many sounds, via as many methods, as you like.

crb@machine:~$ apt-cache search gstreamer | grep alsa
gstreamer0.10-alsa - GStreamer plugin for ALSA
gstreamer0.8-alsa - ALSA plugin for GStreamer

Which is it, though? 🙂

Shutting Debconf up

Monday, July 17th, 2006

Debian's package system, as well as its automatic dependency resolution, has reasonable management of configuration files - not as great as Gentoo, unfortunately, which has some smarts about merging changes, but at least it stops you and tells you what is changing. It does this for files that are labelled as 'conffiles'.

If you're upgrading a lot of alike machines, you can find out what answers you want to load in first, and then tell the others to accept or reject the changes appropriately.

For example, hdparm gets an init script in Dapper that it didn't have in Hoary, so we can safely force an answer of 'yes' for that package:

apt-get install -y hdparm -o Dpkg::Options::="--force-confnew"

However, the firewall rules have been customized locally, and overwriting them with defaults would be bad!

apt-get install -y linuxserver-firewall -o Dpkg::Options::="--force-confold"

ClamAV's packages are a bit smarter, using the newer ucf configuration system, which, among other things, can handle a three way merge - letting you compare new, current and original, in a way that can roll your changes in a bit better. (It's also designed more for files edited or created in postinst, and not just plain configuration files). The syntax for automatic accepting of conffile changes is different for UCF:

UCF_FORCE_CONFFOLD=yes apt-get install -y clamav-base

Look at 'man ucf' and 'man dpkg' for more force options.

lvm2 pre-installation script returned exit status 10

Friday, 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.

Falcon repository builder

Wednesday, June 21st, 2006

While Matt has built a repository system based on reprepro, thanks to Seveas (beware, that link is in Dutch), I've got Falcon working as a Debian/Ubuntu package repository. And in the process, increased the number of bugs fourfold!

The great thing is that he's fixed two of them already and there will probably be a update released today based on that. What great service.

(Is your blog staying at the top of the Planet longer than it should? Is your feed showing the time in the correct time zone? If not, you're posting from 12 hours in the future!)

I'm a Dapper Dan man

Thursday, June 1st, 2006

Allow me to be the first to notify you that Ubuntu 6.06 LTS, otherwise known as Dapper Drake, has been released.

If you were put off by Red Hat 5 and think that Linux is all about clunky command lines, try out the shiny Live CD and prepare to be amazed.