Archive for Linux

Something I’ve been working on …

This is our new student lab, in beta-testing since Friday. The machines run Windows XP and Ubuntu Linux.

Ubuntu Lab Photo

Installation of Ubuntu is fully-automated through Debian installer preseeding. Its partitioner is replaced with a custom udeb that provides formatting for the Linux partitions, while preserving the complex partitioning scheme that Windows/Norton Ghost needs.

Updates and patches get distributed using a custom toolkit written in Python (originally designed by Fabi for RedHat-based systems). It consists of an NFS mount with directories for different classes of machines, and a script (run by cron or on-demand) that checks for new updates to the machine classes a system belongs to. Updates are represented by numbered symbolic links to files, tars, text files with package names to be installed through apt, debs, patches and shell scripts. The on-demand updating and other administrative tasks are initiated through SSH Forced Commands. The postinstall process is also done using the same system, through rc-style numbered scripts.

Each machine has a separate installation partition, containing a netboot kernel, initrd, and the machines’s boot loader (Grub) installed into its boot sector along with the associated configuration files. The installation partition is distributed by Norton Ghost (which is used by the Windows guys anyway to distribute their images), and has the “bootable” flag set. This enables Ghost to install Windows and reboot it multiple times by simply removing the flag and restoring it after installation is complete. By providing a Grub configuration file that will boot into the installation kernel with appropriate kernel parameters for preseeding, any machine running Linux can be re-installed at any time by simply mounting the installation partition and copying the special installation configuration over the normal menu.lst (of course it will have to be reset before the installation reboots for the first time, or we’ll end up in an endless cycle of base installs).

I’ll probably have more to say on this later, but here’s a random collection of “lessons learned” while setting up this lab:

  • FAI and other 3rd party tools are not the only solution, plain Debian installer preseeding works too — or even better than FAI in Ubuntu’s case.
  • Expert recipes for use with partman in Debian installer are unable to deal with complex partitioning setups. We use our own tiny udeb to accomplish this, and radically eliminate partman from the installation process.
  • Debconf does not export DEBIAN_FRONTEND, so when using “noninteractive” as the frontend, make sure the variable is set to “noninteractive” before running anything that might use debconf (such as installing packages). Otherwise some postinstall scripts fail miserably.
  • NIS password changes are broken in pam_unix in every version whose source code I’ve seen so far. I’ve modified 0.76 to make it work, but it’s hardly a good solution (otoh NIS isn’t either, and there’s a chance we won’t have to use it much longer).
  • Python rocks :-)

Comments

Two things nobody ever thought would happen …

Apple switching to Intel processors and Debian Sarge finally being released ;-)

Edit:

And one more thing I didn’t think would happen just yet: A line for the ladies’ room on a technical conference (and that wasn’t the line after the keynote speech where there are lots of media reps and other non-tech people). Admittedly, it wasn’t a very long line compared to the one at the men’s room, but still ;-)

Comments

Quiet for a while …

It’s been rather quiet here for the last weeks since I’ve been very busy taking exams, and helping with orientation for the new students. I also revised the computer labs “manual” each new student gets, and developed a new default configuration for newly created Linux accounts. The new configuration provides better performance on older machines and is more easy to use. It uses Xfce as the desktop manager, Thunderbird for email, and Firefox for web browsing. Hopefully this will make Linux a little easier to use for beginners, and faster on our older lab machines …

Anyway, I still have one more exam to take this week, and hopefully after that I’ll have more time for “the rest of my life” again ;-)

Comments

Ubuntu Linux – Very First Impressions

Today, the first public preview release of Ubuntu Linux was announced: “Ubuntu is a Linux distribution that starts with the breadth of Debian and adds a focused selection of packages, regular releases (every six months), a clear focus on the user and usability (it should “Just Work”, TM) and a commitment to security updates with 18 months of support for every release.”. And all of this while being free as in freedom, and free as in beer. Sounds too good to be true? Well, I took it for a test drive on my iBook G3. Here are my purely subjective and totaly incomplete first impressions …

Getting It

The current preview comes as a single ISO image, available for i386, ppc and amd64 architectures (a Live CD is apparently in the works). It can either be downloaded from one of the mirrors or by BitTorrent. Burning the image to CD on Mac OS X poses a problem since, for some unknown reason, Disk Utility crashes when trying to open or burn the image. The image itself is perfectly fine, mounting it in the Finder or burning it using cdrecord works. After overcoming those little hassles, it’s off to the installation …

The Installation

Before the installation, the iBook had two partitions, both of which contained a Mac OS X installation. I decided I would delete one of them to make room for Ubuntu, and keep the other to see how it works with a dual boot setup. After booting from the CD, the installer asked very few questions (language, time zone etc.), and attempted to detect hardware. My ethernet and AirPort cards were detected correctly, but setting up the ethernet card to use DHCP failed (for some reason the installer came to the conclusion that I was “not connected to to a network”). Since I was installing from CD anyway, I just told it to configure it later and continued the installation. If you want to get an impression of a typical installation, take a look at the installation howto.

For partitioning, it gave me the option to either erase the whole disk, or partition manually. I chose the latter, deleted one of my two HFS+ partitions, and created an ext3 partition for the root filesystem, a swap partition, and a new world bootloader partition instead. This was about all it asked of me during installation (well, I think I remember being asked to create a user account as well, but no root account: by default, root access is granted only using sudo). From then on it continued automatically — no package selection phase, X configuration (the first release in October will still use XFree86, the subsequent ones are supposed to include X.org), or anything else one has come to expect from a Linux installation. So, after the usual reboot and package installation, I was pleasently surprised to be dumped directly onto a very sleek looking login screen :-)

First Impressions

Go look for yourself. Antialiased fonts, Firefox as the default browser, and an interesting menu setup. And (most of) it just works: The iBook-specific buttons (volume, brightness, eject) function as expected, sound, plugging in an USB mouse with 3 buttons and scroll wheel, and of course the X configuration without any … configuration ;-)

I ran into some trouble getting nameservers by DHCP, apparently the dhclient-script that comes with the PPC version of the preview release is broken. Replacing it with the script from the i386 version fixed the problem. Also, the Network Admin utility crashed occassionally, complaining that it could not run as root when trying to (de-)activate network interfaces, even though I typed in my password earlier. But I managed to configure my network interfaces anyway.

On my “not instantly working” list so far: Power management, emulating right and middle mouse button with a single-button mouse/trackpad, playing audio cds. I’ll look into that when I have more time …

Package Management and Components

Ubuntu uses Synaptic as a user-friendly front-end to apt. Installable software is divided into three components: main (free software packages maintained by Ubuntu developers), restricted (commonly used non-free software, maintained to the extent permitted by the license), and universe (almost every open source and less open software, but without guaranteed security fixes and support). After activating the pre-defined repositories for these components, a huge collection of packages is available for installation.

Conclusions

Though certainly not for newbies yet, it’s great preview release. Go out and test it, and file bugs, so the first release of Ubuntu Linux in October can be close to perfect. Specifically regarding a Mac, it was the easiest installation I have experienced so far. And the features planned for future releases look just too good to be true :-)

Comments (4)

Useful Unix Commands: fmt

For a while, I’ve been keeping a file of useful Unix commands and interesting usage examples. I’ll post some of those here from time to time.

I’ll start with a nice little utility
that reformats text to a given line width: fmt. The basic syntax is
quite simple: fmt -80 myfile.txt formats the text
contained in myfile.txt to a maximum line width of 80 characters and outputs
it on standard out (like most Unix commands, fmt will take its
input from standard input if you omit file name).

fmt inserts line breaks as necessary (any whitespace character is a valid insertion point), and also removes unncessary line breaks. Line breaks
that mark the end of a paragraph will be preserved (the end of a paragraph is defined as a line break immediately followed by another, or a line break on an empty line).

Additional command-line options apply uniform spacing (-u for the GNU version, -s for the BSD version), format mail header lines
sensibly (-m BSD only), and specifiy a goal length the output
lines should get as close as possible to, while not exceeding the specified maximum line width (fmt ..., BSD only). Another nifty use of fmt in the BSD version is to center
lines of text. For this, only the -c option has to be specified
(and the input file(s) if the input is not read from standard input).

Of course there are much more powerful text processing utilites available on
any given Unix system, but often simple utilities like fmt are
completely sufficient and much easier to learn ;-)

Resources:

Comments (2)

« Previous entries Next Page » Next Page »