Code:
startx now checks /tmp/.X11-unix/X* when choosing a display number.
/usr/bin/startx:35
[ -e "/tmp/.X$d-lock" -o -S "/tmp/.X11-unix/X$d" ] || break
Previously it only checked /tmp/.X*-lock and rc.M cleaned those files.
If a system hard crash happens while X is running the socket
/tmp/.X11-unix/X* is not cleaned up, then that display will
be skipped on the next X startup. This can lead to unexpected results.
Add /tmp/.X11-unix/* to the rc.M file cleanup.
---
rc.M | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rc.M b/rc.M
index 30c8529..5f16d26 100755
--- a/rc.M
+++ b/rc.M
@@ -150,7 +150,7 @@ if [ -x /etc/rc.d/rc.ntpd ]; then
fi
# Remove stale locks and junk files (must be done after mount -a!)
-/bin/rm -f /var/lock/* /var/spool/uucp/LCK..* /tmp/.X*lock /tmp/core /core 2> /dev/null
+/bin/rm -f /var/lock/* /var/spool/uucp/LCK..* /tmp/.X*lock /tmp/.X11-unix/* /tmp/core /core 2> /dev/null
# Remove stale hunt sockets so the game can start.
if [ -r /tmp/hunt -o -r /tmp/hunt.stats ]; then
--
2.18.0
Note that I haven't had a recent hard crash to test this, but I am running the patch on my system.