Making it easy to try DTrace4Linux

DTrace4Linux is an attempt (from UK developer Paul Fox, also known for his CRiSP editor) to bring the power of DTrace to Linux. It’s a kernel module (No kernel recompilation required! Yay!) and userland tools.

I did a bit of hacking around with Vagrant and Puppet and VirtualBox to make it dead easy to try.

Tweeted here.

Ubuntu mirror troubles

This has been happening all day every time I attempt to do apt-get dist-upgrade:

The following packages will be upgraded:
  libsmbclient samba samba-common smbclient smbfs
5 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 11.0MB of archives. After unpacking 4096B will be used.
Do you want to continue? [Y/n/?]
Writing extended state information... Done
Err feisty-security/main smbfs 3.0.24-2ubuntu1.3
  403 Forbidden
Err feisty-security/main smbclient 3.0.24-2ubuntu1.3
  403 Forbidden
Err feisty-security/main samba 3.0.24-2ubuntu1.3
  403 Forbidden
Err feisty-security/main samba-common 3.0.24-2ubuntu1.3
  403 Forbidden
Err feisty-security/main libsmbclient 3.0.24-2ubuntu1.3
  403 Forbidden
E: Failed to fetch
403 Forbidden

Possible fix for using apt through a broken HTTP proxy

Seen on a work email list. A possible solution to the problem where files downloaded through apt-get on Ubuntu at work (where we have a squid HTTP proxy) periodically get corrupted.

Put the following in apt.conf:

Acquire::http::Pipeline-Depth "0";

Quote from man apt.conf:

One setting is provided to control the pipeline depth in cases where the remote server is not RFC conforming or buggy (such as Squid 2.0.2) Acquire::http::Pipeline-Depth can be a value from 0 to 5 indicating how many outstanding requests APT should send. A value of zero MUST be specified if the remote host does not properly linger on TCP connections – otherwise data corruption will occur. Hosts which require this are in violation of RFC 2068.

Got suspend to disk working on my Asus S-presso

As previously mentioned, I was trying to get suspend to RAM and/or suspend to disk working on my Asus S-presso box with Ubuntu feisty.

Well, I got it to work. The problem was lame – for some reason when I installed uswsusp and it regenerated the initrd, it only did the 2.6.20-16-generic file and I was running the 2.6.20-16-386 kernel. I just had to do a mkinitramfs -u -k $(uname -r) and that updated the proper initrd for my kernel of choice.

Now I suspend to disk by doing sudo s2disk and then later when I power on the machine and choose the relevant item in the grub menu, the newly generated initrd will automatically resume by reading from my /dev/sda5 swap partition.

I also played with s2ram, but haven’t had too much luck there yet. My machine is not in the whitelist and I tried forcing it with -f and other options. What seems to happen is the machine attempts to suspend to RAM but then gets immediately woken up and goes right to the GNOME screensaver password prompt. I also tried upgrading to the latest version of uswsusp (0.7 [2007-09-03] instead of the 0.3 version that is in Ubuntu Feisty). No dice. Heck, perhaps my machine has a broken ACPI implementation. From what I hear, the ACPI spec is quite complex and is often poorly implemented.

I’d like to get s2ram working (any ideas?), but at least now I have s2disk working.

S-presso => no sleep

Computing mirroring real-life. Espresso is not conducive to sleep and neither it seems is the Asus S-presso small-form-factor PC.

I have an Asus S-presso small-form-factor PC that runs Ubuntu and is on all the time, because it is the print server for our Canon i950 ink jet printer.

Now my wife and I have decided to be more green/eco-friendly and to save money on our electricity bill, so running a computer 24/7 is not really helpful in that regard.

I got out my Kill-A-Watt last night and measured power demand of a power strip that serves the computer, printer, monitor, external hard drives, USB hub, etc. With the computer running in its normal steady state, usage seemed to be around 160 to 180 watts. With the computer powered off, I believe it went down to around 18 or so. If I actually unplugged the computer, I think it went down to around 11 (the computer has a front-panel display with a clock when it’s off but plugged in). Even after unplugging the computer and monitor and printer and such, I don’t think I got the usage below 9 watts (Perhaps the power strip LEDs?).

Powering the computer off at night and when we’re not using the printer would save power but would be a bit inconvenient. Ideally, we could have it suspend to RAM or disk and then use Wake on LAN to wake it up when we need it.

Well, I checked the BIOS settings and made sure that all the ACPI and APM stuff looked in order and then I booted up Ubuntu and tried to suspend it via GNOME’s power management stuff. Well, the computer yawned a bit and the monitor lost signal and the computer went to sleep for all of a second or two before promptly waking up and presenting the password prompt to unlock the screen. I tried this a few times. I checked the BIOS to see if anything was set to wakable and I couldn’t find anything.

Then I tried hibernating. First there was the obstacle that I apparently had no swap partition. Apparently during one of my upgrades, partition names changed and my fstab was no longer up to date so I had been unknowingly running without a swap partition. Oops. Well, that was easy to fix with a quick edit to fstab and an invocation of swapon. Now I tried to do a hibernate. The system jumped to text mode and dutifully wrote out the contents of RAM to swap, as I observed with the nice percentage done progress indicator. Then the system powered down and power usage was down to a nice 18 watts. Only problem was that pressing keys didn’t wake it up and when I pressed the power button on the machine, it did a complete cold boot and never made any attempt to restore the hibernated state.

After that I looked through the repository at a confusing bunch of power management stuff, including powernowd, powersaved, cpudyn, hibernate, and uswsusp and I tried to install some of them (some of them conflict with others) and had no luck. I also had no luck throttling the speed of my processor (Pentium 4 3.0 GHz)- it appears that my processor doesn’t support SpeedStep or the like.

Eventually, it was late and I gave up and powered the computer down for the night. I guess I will power the computer down every night and power it on in the morning, at least for now. I may give some thought to getting a little $50 Ethernet USB 2.0 print server box (e.g.: IOgear GPSU21, RJ45/USB 2.0, $53.99 ; though I recall these things often require special client software and don’t typically support bidirectional communication) or maybe just getting rid of the ink jet (which costs a lot of money in ink cartridges anyway) and replacing it with a networked laser printer (e.g.: Samsung ML-2571N, $109.99 after $50.00 Mail-In Rebate).