Bug#169019: (startx fails to start x from console). FIX
I have found the cause of this problem and its solution. The problem is
in the file /etc/Xsession (global Xsession file -- used by display
managers and xinit (startx)) supplied by the xfree86-common package. So
please forward it to the maintainer of that package.
In the above file there is function:
run_parts ()
which reads file names incorrectly if I'm at my console. If I'm at a
dumb terminal, it works fine and typing startx will start x OK. The
line in run_parts () that reads the files in directory $1 incorrectly is:
for F in $(ls $1); do
Well, I've set up directory colors on my Linux box so that files are
color-coded by type of file. I do this in my /etc/profile file:
if [ $TERM = linux ]; then # set LS_COLOR environment variable
eval `dircolors`;
ls () { command ls --color $* ; }
So "ls $1" returns a lot of escape codes for creating colors along with the
file names. The result is that X exits. To fix this change the line to:
for F in $(command ls $1); do
The "command ls" insures that ls is not a shell function but the real ls
command.
David Lawyer
Reply to: