Comment 2 for bug 678421

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote : Re: Error in ~/.profile halts the X startup

I want to correct myself: When discussing this with more experienced developers, my attention was called to the fact that I had missed the distinction between syntax errors and other errors. While a syntax error kills the process, other errors, e.g. "not found", don't. Hence you can disregard my talk about the -e option.

A possible solution did come up. Replacing this /etc/gdm/Xsession line:

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

with

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

would protect against a ~/.profile syntax error causing the process to be killed. For two reasons it's not considered appropriate, at least not as soon before the 11.04 release as we are now:

1. Regression risk due to the ~/.profile commands being run twice (even if they would be run in a subprocess the first time).

2. Efficiency loss.

For the case the conclusion will change after the 11.04 release, a merge proposal with the above solution is available.