mok0's world

Sacrosanct Linux feature dies

Posted in Linux, Ubuntu by mok0 on March 23, 2012

I’ve been using Linux since 1996. Since then, the OS has undergone an amazing development, and all distributions provide an impressive high-resolution graphical interface. However, one feature has remained sacrosanct: the 6 virtual terminals. In the old days, when you had to provide timings for the video card and manually edit the xfree86 config file, it was easy to mess up the graphics display. But then, CTRL-Alt-F1 to the rescue! It was ALWAYS possible to get a terminal and consequently access to the operating system. And, in addition, most of the GUI versions of system setup programs had a TUI analogue, that could be run from the 80 x 24 terminal.

Until now. Ubuntu 12.04 BREAKS the virtual terminals on many older video cards, because it insists in using frame buffer mode, presumbly to provide fancy, meaningless, silly graphics for the boot screen. This is what my virtual terminals looks like now:

Ubuntu 12.04 Virtual Terminal


This is a scandal, no more, no less! Breaking the virtual terminals, that ALWAYS have been available, no matter what video card you had in your computer, breaks the promise that you always can obtain a console to control Linux. Simply a very, very bad design decision.


Disk Quota Exceeded?

Posted in Debian, Linux, Ubuntu by mok0 on April 11, 2011

The disk quota system in Linux is quite old, and if you have a distributed workstation environment with NFS mounted shares it is not possible in a convenient way to inform users that they have exceeded their disk limits.

So we created a simple disk quota warning system, written in Python, that works using the notification interface (libnotify). A user who has exceeded the disk quota is then at regular intervals presented with a pop-up warning like the one shown in the figure below.

disk quota exceeded pop-up notice

The quotawarn system is divided into three parts. Two of them run on the file server, and one on the users workstation, under the users’ own UID.

On the file server, there is a program called quotawarn.cron, which (duh!) should be run at regular intervals by cron. This program simply runs repquota and squirrels away the information in a convenient format. Currently, this is simply a pickled Python dictionary indexed by UID, but could of course also be a fancier database storing historical data on each user’s disk usage.

The second program on the server is a CGI script. Using the standard web interface lets us rely on the access settings in the HTTP server, thus minimizing the need to program a special security system, and relieving the burden on the sysadm of learning and maintaining yet another access control system.

Quotawarn.cgi responds to messages from the network, replying to requests for specific UIDs by transferring the data for that user in JSON format. Or, optionally, by creating an HTML page with the data of all users.

On each workstation, the notification script quotawarn is started when the user logs on. The sysadm can achieve this by placing an entry in /usr/share/autostart. The program will ask for data from quotawarn.cgi on the file server, and if the user is under the disk quota limit, the program will exit without any more noise. If, however, the users disk quota is exceeded, the program will pop up a notification (shown below). This will continue at regular intervals (set by the sysadm).

A second notification system, yet to be developed, could hook into Ubuntu’s motd system, and provide the necessary information when the user logs on via an ssh connection to the network.

quotawarn system diagram

I have created a project on Launchpad for quotawarn in the hope that others would like to contribute to the project, and make it more generally usable. Although an attempt has been made to make the system general, we have not been able to test it in other settings than our own. So, if this has whet your appetite, please feel free to branch the project and contribute!