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. (B)