xterm has a -C option that causes it to run as a "console" --
that is, the xterm displays messages sent to the console. This
is a handy thing -- I usually run a small console xterm in one
corner of my laptop's screen, so that I can see things that are
going on in my system.
Unfortunately, this functionality seems to be broken under Fedora.
Now, when this feature *usually* breaks, it's *usually* due to
/dev/console permission problems. But not this time -- gdm properly
gives me ownership of /dev/console when I log in:
% ls -l /dev/console
crw------- 1 shivers root 5, 1 2007-12-11 15:31 /dev/console
%
Nonetheless, when I run xterm -C I get an error message:
% xterm -C
xterm: cannot open console: Operation not permitted
and the xterm doesn't display any console messages. Furthermore, when
I search for operations on /dev/console with strace I get these:
% strace xterm -C 2>&1 | fgrep dev/console
stat64("/dev/console", {st_mode=S_IFCHR|0600, st_rdev=makedev(5, 1), ...}) = 0
access("/dev/console", R_OK|W_OK) = 0
%
What's weird is that, according to strace, the access() call is *winning* --
zero return means access is permitted.
One more odd sympton: if I run xterm -C as root, then
- I *don't* get the "cannot open console" error message (which is good);
- strace says the stat64() call happens, but the access() call isn't even made (which is odd);
- the xterm does *not* display console messages (which is bad).
Here's an example:
# strace xterm -C 2>&1 | fgrep console
stat64("/dev/console", {st_mode=S_IFCHR|0600, st_rdev=makedev(5, 1), ...}) = 0
#
I also observe, by the way, that the venerable xconsole program has similar
kinds of lossage. Xconsole is nice because it's not interactive -- it's
display-only. This is nice, because I hack my gdm scripts so that the
login panel puts an xconsole in the lower right corner of the screen. That
way, you can see what's happening on the machine, even if you aren't logged
in and can't run any commands. But under Fedora, this doesn't work and I
can't figure out why.
Does anyone have any suggestions? Should I file a bug report to Fedora?
I realise that this kind of UI is pretty old-school -- most people get their
notifications one painful, intrusive pop-up at a time via a notification
applet in a gnome panel, instead of simply having them neatly stream by on
a console. Call me traditional. It's a documented feature in these apps; it
should work.
-Olin