You are here

Curse /etc/X11/gdm/Xsession and its .profile-running behavior!

I just spent way longer than I care to admit spread over the last week debugging why the new Ubuntu install someone put on our Linux Lab computers bit it everytime it tried to start X for me…

As usual, if I'd spent less time trying "things" and more time paying attention to the evidence clearly in front of me, I could have debugged it in a few minutes.

At any rate, the problem turns out to be these offending lines of code in /etc/X11/gdm/Xsession:

test -f "$HOME/.profile" && . "$HOME/.profile"

Now I understand the noble goal here. If you happen to be running the Bourne shell, there's no other per-user place environment variables can get set. And if you're running bash, some people get it wrong anyhow.

But darnit, as far as I know your Bourne shell .profile is supposed to be run only for interactive shells—and I count on that. My .profile selects a shell and execs it, using a complicated preference system. Needless to say, sourcing my .profile in the middle of a non-interactive script doesn't work. At all.

I have a workaround in place, and will replace it soon with a better one. My X starts up now. Heaven knows my setup is a freakshow, and hadn't been tested with Gnome for years.

Still, customizations in the UNIX environment are getting harder to do now, and more fragile. I have no idea what to do about this, but it's becoming something of a showstopper for geezers like me.

Caveat Luser, I guess. Fob

Comments

funny parody of your problem.

Yeah, I noticed that parody yesterday. Nicely done in many spots. The Xserver boot log was barely parody, though. Fob

Yep, time for a monolithic registry! Or maybe a zillion XML-ish property files instead?

Although I do wish people would give up and just admit that XML has won as a configuration language, that isn't what I was driving at. I don't have a great remedy for my problem.

Two things that would help: First, make sure that the semantics of configuration files is well-defined and well-understood. Either it's OK for me to put wacky startup stuff in my .profile, or it isn't; the usage of .profile should be more clear than it is. Second, resist the configuration to use programming languages as configuration tools. The biggest problem here is that setting environment variables—a configuration task—is not separated from initializing a user environment—a programming task—in any standardized way. Programs that just want the configuration are somewhat out of luck.