Since pre-historical times, I have been using a little trick to automatically launch the GUI on Linux systems. I put code like:
Code: Select all
[ $(tty) = /dev/tty2 ] && exec startx
This has always worked on regular Linux, but today I decided to give it a shot on the Pi (Raspbian).
Note, BTW, that when combined with putting "-a pi" in the /etc/inittab line for tty2, you get an automated launch of the GUI without needing to manually logging in.
However, when I did this on the Pi, it went into an infinite loop, launching zillions of copies of "xinit" and never displaying the GUI. In fact, the console was locked up (couldn't do any Ctrl/Alt/Anything) - and recovery was only possible by ssh'ing in to:
- 1) Undo the change in the .profile
2) killall -v xinit
After fiddling with this for a while (repeating it several times to be sure it really was doing this), I eventually changed it to:
Code: Select all
[ $(tty) = /dev/tty2 ] && {
pidof xinit || exec startx
}
My question is: Why does this happen?
I'm guessing it has something to do with the complicated GUI that runs on the Pi - a complicated shell that launches lots of processes and stuff - probably something along the way is running the .profile again. I assume if I stripped it away and went back to using, say, twm, as my window manager, the problem would go away. Still, I'd like to know what piece of software is the culprit here.
Anyone know?