A thing I don't like about Linux

December 14, 2005

So much for my nice uptime. As I was browsing along in Firefox, the X server crashed. (The crash was for the usual reason: trying to display some characters in some fonts gives the X server a signal 11 heartburn. Ever once in a while, I'll stumble over a web page that nails just the right combination.)

A crashed X server doesn't take the system down on the spot, but on Linux it makes the console pretty much unusable because the X server is the only thing that can take the hardware out of graphics mode. This means I can't read anything on the console, even if I restart the X server, which makes the machine useless from a practical perspective.

Rebooting my machine is somewhat time-consuming process, lengthened this time around because all of my filesystems were well overdue to be fsck'd, and it was not exactly what I'd been planning to do late this afternoon. Plus, you know, the whole thing about losing my entire session in a ka-blam.

So I really wish Linux would recover more gracefully from X server crashes.

Now that it's happened, I'm not too angry; really, a reboot was overdue anyways. The machine's kernel is seriously out of date and missing various sorts of networking goodies that I'd been leaving out of my kernel configurations until I learned better semi-recently. Since I've had to reboot already, I might as well build a modern kernel with all the goodies and switch to it; I've already lost the nice 315 days and 4 minutes uptime.

I still wish it'd been up to me when exactly to schedule the reboot, as opposed to X server bugs.

Sidebar: cleaning up from an X server crash

It's possible to get console input back and thus to do blind typing, if you have the 'Magic SysRq' key enabled. This is Alt plus SysRq (aka 'Print Screen') plus various special keys; here, the must useful is 'r', to take the keyboard out of the raw mode that the X server's left it in. Once the keyboard's out of raw mode, you can flip screens with Alt-Fn (although you probably won't see anything useful) and use Ctrl-Alt-Del to do a reasonably orderly reboot and so on.

(Other useful keys: 's' to sync, 'u' to unmount filesystems or make them read-only, and 'b' to reboot the system. See Documentation/sysrq.txt in the kernel source code for a full list and more information. Note that 'b' reboots immediately, without sync'ing.)

A number of distributions default to disabling Magic SysRq. Make sure that if your /etc/sysctl.conf mentions kernel.sysrq that it sets it to a value of '1', not '0'. (This is also /proc/sys/kernel/sysrq.)

However, logging in over the network from another machine is usually the much easier way to deal with things.

Written on 14 December 2005.
« What Python threads are good for
Reddit versus Digg: a little detail that matters »

Page tools: View Source, Add Comment.
Search:
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Wed Dec 14 01:09:50 2005
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.