Terminator 0.13 released!
June 23rd, 2009 cmsjI’m very pleased to announce the release of Terminator 0.13!
You can find the download on Launchpad or see more at the Homepage. Enjoy!
I’m very pleased to announce the release of Terminator 0.13!
You can find the download on Launchpad or see more at the Homepage. Enjoy!
I’ve not been doing a huge amount of work on Terminator recently – I have to be honest and say that a lot of the fun stuff is already done and behind us, and it’s just got a couple of features before it’s as complete as it should be, also it’s now well over 2 years into the long-slog towards the often-marvelled-about decade it takes for a piece of software to be truly mature.
That’s not to say that I haven’t still got a burning interest to do good works in the FOSS world. Recently I’ve been poking around at other things. I’ve got a patch in GNOME’s Bugzilla which fixes the stupid bug where mailto: URIs get mangled when you open them, and yesterday I submitted a branch to the GNOME Do folks which adds a plugin for users of Request Tracker (being a sysadmin, RT rules my working life).
Hopefully both will get merged soon! Now I need to figure out what I should poke at next in 2009 (my rough aim for the year being to produce more and consume less).
I’ve just uploaded a new version of Terminator!
This time we merry band of elves bring you a delightful mix of bug fixes and new features. Here’s the change log:
* Bug fixes
* Simultaneous typing support
* Directional terminal navigation
* Improved search UI
* Graphical Profile Editor
* Bug numbers for launchpad.net are now URLs
Head over to the homepage or Launchpad for the goodness. I’ve already pushed out source packages to the Ubuntu PPAs, which should be spinning up buildds soon, so expect binary packages shortly. I’m sure we’ll filter into Debian, Ubuntu Jaunty, Fedora, FreeBSD and more soon enough :)
One of the nice side effects of being at an Ubuntu Developer Summit is the interesting conversations you have with people outside of the sessions themselves (which, as a sysadmin present to support the event itself, I was not particularly involved in).
One such conversation was over lunch in a busy Google canteen with Kees Cook, one of our rocking security engineers and a thoroughly decent chap. After a while we came to the subject of Terminator and some of the features we’d like to implement, the ones that have been requested and we’re not particularly motivated to work on, and the odd ones.
I was trying to remember the things people have asked us to add, that for one reason or another we probably aren’t going to and mentioned one about the ability to navigate between terminals in a directional way: That is, rather than doing Ctrl-Tab to cycle through the terminals in the order they were created, you could press something to move to the terminal to the left, or above, right or below the currently focussed one.
On the surface it sounds like a good idea and probably not too tricky, but only if you think from the point of view of a grid. That really would be easy, but our UI is produced by way of a tree structure, not a grid. This means you need to do some proper thinking to figure it out. Kees’ face lit up and he said something like “that sounds like a graph theory problem!” and expressed an interest in working on it.
I’m very glad to say that in just under a week after we all went home from UDS, I’ve just merged his results into trunk.
Thanks very much to Kees for his code and helpful suggestions (such as resurrecting Marcus Korn’s simultaneous-typing branch, which I did one evening at UDS – rewriting it and then merging it into trunk). Also thanks to the other Terminator users I met there :)
So that’s two new features, although not really the big ticket ones that are holding back 1.0 ;)
In one word: wow.
Out of sheer curiosity last night I fired up the excellent powertop and decided to see how my system was doing. It was producing a couple of hundred fewer interrupts per second than it did in 8.04 (Hardy), and was using 1-2Watts less power.
Previously I have always resisted applying tweaks to my laptop that would attempt to reduce power, but since things were improving, the temptation was simply too great and I started digging out all the resources on this (by far the most useful being the tips on Intel’s grammatically horrific http://www.lesswatts.org/). I had two reasons for not doing this previously – firstly I didn’t want to deviate too much from a default install of Ubuntu (if only because it makes it much harder to reproduce bugs), but secondly I kept running into little weirdnesses. The most inconvenient of these was enabling AHCI link power management (which basically puts the hard disk bus to sleep when there is no IO); Enabling this and then suspending the laptop produced a 5 second delay on resuming because the kernel was forgetting it had put the bus to sleep and so had to wait for it to time out and be reset.
This particular niggle is fixed in 2.6.27 and so my 3-4 second resume times are preserved and I can save power! \o/
After a little while tweaking disk, AHCI, USB, filesystem, wireless, sound and ethernet options I ended up with a system which runs between 8 and 9 Watts when idle, down from 10-14 Watts, which I think is a pretty impressive saving and I’m very curious to find out from other Thinkpad X300 owners how well Windows performs in the power usage stakes – we always hear that Linux is a bit worse, but I’d be really quite surprised if the machine can run with very much less – it’s spending (when idle, obviously) 99% of its time in the deepest processor sleep state and is only generating about a hundred interrupts per second (about 70-80% of which are due to my using a 3D desktop and wireless).
If you’re playing with the excellent new ChrootDirectory and internal-sftp options in recent OpenSSH releases (such as 5.1 which is in Ubuntu 8.10 Intrepid), you may have hit an error like:
fatal: bad ownership or modes for chroot directory
You may also have searched on Google for what to do about it and come away with very little useful information.
Well no more! I did the same thing and got bored of reading mailing list posts, so read the source code instead. The relevant section is in session.c:
if (stat(component, &st) != 0)
fatal("%s: stat(\"%s\"): %s", __func__,
component, strerror(errno));
if (st.st_uid != 0 || (st.st_mode & 022) != 0)
fatal("bad ownership or modes for chroot "
"directory %s\"%s\"",
cp == NULL ? "" : "component ", component);
This is quite simple really, it’s stat()ing the directory specified for “ChrootDirectory” and all its parents up to / and checking that they are:
Note my emphesis that these checks apply to the chroot directory itself and its parents and /, so if you are chrooting users into /srv/chroot/ then you need to ensure that /, /srv and /srv/chroot are owned by root and not writable by the group (even if it’s root, bizarrely) or other users.
Sorted.
I have a laptop with some USB stuff built in. Some devices (such as Bluetooth) can be made to entirely disappear from the USB bus, however, the fingerprint reader and webcam can’t, but they sit on the USB bus and draw power.
Fortunately the USB specs allow devices to be put to sleep if they’re not being used and support that feature. Unfortunately many devices advertise they support it when they really don’t, so Linux is unable to automatically put every USB device to sleep.
Fortunately you can control the setting by hand, and this is how. Firstly, start off with a Terminal and run the command “lsusb”:
cmsj@kodachi:~$ lsusb
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 0483:2016 SGS Thomson Microelectronics Fingerprint Reader
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 002: ID 17ef:4807 Lenovo
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
cmsj@kodachi:~$
You can ignore the “root hub” entries, the interesting two are “SGS Thomson Microelectronics Fingerprint Reader” (guess which device that is ;), and “Lenovo” (this is the webcam).
So now we need to poke at those devices to enable their autosleeping. If we look at the entry for the webcam:
Bus 004 Device 002: ID 17ef:4807 Lenovo
I’ve highlighted “4807“. This is the Product value for this USB device (if you’re curious, the “17ef” part is the Vendor value and uniquely identifies the maker of this device).
Now we need to find out where abouts the webcam lives in the /sys/ filesystem (which is something the kernel provides to give applications lots of information about the hardware in your system).
The following command will put us on the right path:
grep 4807 /sys/devices/*/*/usb*/*/idProduct
Which, on my laptop, returns:
/sys/devices/pci0000:00/0000:00:1d.7/usb4/4-5/idProduct:4807
Take that information you get, and chop the “idProduct:4807” bit off the end, just leaving “/sys/devices/pci0000:00/0000:00:1d.7/usb4/4-5/” (yours will look a little different to this) and add “power/level” to the end.
You should now have something that looks pretty much like “/sys/devices/pci0000:00/0000:00:1d.7/usb4/4-5/power/level” and if you get the current setting:
cmsj@kodachi:~/Desktop$ cat /sys/devices/pci0000:00/0000:00:1d.7/usb4/4-5/power/level on cmsj@kodachi:~/Desktop$
you can see it is “on”, which means it will not be automatically put to sleep. To change that, run:
echo "auto" | sudo tee /sys/devices/pci0000:00/0000:00:1d.7/usb4/4-5/power/level
and test if your device still works (so if it’s a webcam, fire up “cheese“, or if it’s a fingerprint scanner that you use, test if it still accepts your finger). If everything is good then you can put something in /etc/rc.local so the power saving will be set up every time you reboot your computer:
echo "auto" > /sys/devices/pci0000:00/0000:00:1d.7/usb4/4-5/power/level
and that’s it! Repeat this for all the USB devices in your laptop and enjoy the power saving (run “powertop” about 10 minutes before you start doing this so it has time to get a good average of your power usage, then see how much difference this makes. It could be up to 0.5Watts per device). Note that this won’t work particularly well for external USB devices you plug in, becuase the /sys/ path won’t exist until you plug the device in, so you’d need to do the above steps every time you connect it.
Hopefully HAL will start whitelisting devices which can be suspended, but I don’t know of any work in this direction at the moment.
Head over to the Terminator Homepage to get the goodness that is version 0.11. Mostly just bugfixes this time, for things which hurt 0.10 users. Also present is support for X Session Management, although until we have proper profiling support, this is of limited use.
The source tarball is up, of course, and the Hardy/Intrepid PPAs should have packages by the time you read this.
I just uploaded a script that I’ve been using and refining for some while, with help from a variety of people too numerous to mention.
Basically the deal is that when you ssh somewhere from inside a GNU Screen session, the screen’s title is set to the hostname you ssh’d to. Simple.
The page for the script is here
It’s been a week or so shy of two months since we pushed 0.9 out of the door and originally we planned on following up with a 0.9.1 release shortly after to clear up some bugs, but for a variety of not particularly good reasons this never happened.
Instead we’ve got a new release for you… 0.10.
It doesn’t have any shiny whizz-bang features like 0.9 had, but it does bring a bunch of bug fixes and the groundwork necessary for our 1.0 release.
As usual, head over to the homepage, or Launchpad to get the goodness.