Comment 8 for bug 678421

Revision history for this message
Egon Elbre (egon-elbre) wrote : Re: Error in ~/.profile halts the X startup

Sorry, I forgot about this due to other duties (work and school).
This is not an active issue for me, but would be a nice touch to Ubuntu.

This still happens in Oneiric (tested in daily). There are some differences,
it just drops you into the default login screen without any explanation.
Which is quite bad because then you will be puzzled what just happened/went wrong.

Also I did some research how to keep the main script running when
sub-script has some syntax errors:

#####

set -e
ERRCODE=0
(. "$HOME/.profile") || ERRCODE="$?"
echo $ERRCODE

#####

ERRCODE will be
0 if everything was ok
127 if there was a syntax error
>0: there was some other problem with the script

That way we can get the correct error code without terminating the main script
and do graceful handling of the error.