I've set up automatic login and made X auto start like this:
#!/bin/sh if [ -e "/tmp/X0-lock" ]; then echo "X has already been started" else /usr/bin/startx fi
xset s off -dpms & ratpoison & ~/userapp/demo while [ -f /userapp/demo/.keepalive ] do ~/userapp/demo done sudo /sbin/reboot
This works great in the sense that it starts X (with ratpoison) and my application, and it also restarts the application unless that .keepalive file is missing (which is something defined by the application).
The problem however, is that on the Raspberry version of Debian Wheezy,
there is no
X0-lock file in the /tmp/ directory to indicate X has started so
the check in
will always return false and an attempt will be made to start X every time.
How can I check if X has already been started on the Raspberry?