Tiny Core Linux
Tiny Core Base => TCB Talk => Topic started by: maro on August 26, 2011, 11:40:23 PM
-
If the X server fails to start the subsequent execution of 'hsetroot' will end up in a segmentation fault. This is IMHO not ideal as the failure is conveyed more as a side effect and not directly checked.
As I've fallen myself now a few times into the "trap" and wrongly assumed this to be a segmentation fault of the X server itself, I'd like to suggest an additional "protection" in '~/.xsession' (or rather more correctly: '/etc/skel/.xsession') by replacing the single line 'waitforX' with:
X_PID=$!
waitforX
busybox ps -o pid | grep -q "^ *${X_PID}$" || ! echo no X server || exit
-
In such a case, waitforX should print an error message and return 1 (unless the X server actually started and worked for a while).
-
Good point, but it does not work for the test case that triggered me to write this (i.e. testing TC 4.0a1 in a QEMU VM with KQEMU enabled, where 'Xvesa' fails with an 'Illegal Instruction').
I've now an even shorter suggestion to achieve the same:
waitforX || ! echo failed in waitforX || exit