diff options
author | Chris Mayo <aklhfex@gmail.com> | 2019-07-26 19:48:13 +0100 |
---|---|---|
committer | Matt Turner <mattst88@gentoo.org> | 2019-07-29 18:49:41 -0700 |
commit | 6f680e4fe73925ae130343e02adb416cb799ce7d (patch) | |
tree | 3ae2edc43e9213c935c02915c7fe3e4c6f230810 /eclass | |
parent | x11-base/xorg-server: Suppress meaningless errors during shutdown (diff) | |
download | gentoo-6f680e4fe73925ae130343e02adb416cb799ce7d.tar.gz gentoo-6f680e4fe73925ae130343e02adb416cb799ce7d.tar.bz2 gentoo-6f680e4fe73925ae130343e02adb416cb799ce7d.zip |
virtualx.eclass: Fix no display for an emerge following a failure
If using GNOME GDM, X is started on DISPLAY :0 but a lock file
/tmp/.X1024-lock is created instead of /tmp/.X0-lock.
virtx() will initially set XDISPLAY to 0 and attempt to start Xvfb on
DISPLAY :0 which fails but DISPLAY :1 (and greater) is not attempted if
a previous emerge left /tmp/.X1-lock behind.
Closes: https://bugs.gentoo.org/690778
Signed-off-by: Chris Mayo <aklhfex@gmail.com>
Signed-off-by: Matt Turner <mattst88@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/virtualx.eclass | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass index fb6a867a35cc..40eeea5463bc 100644 --- a/eclass/virtualx.eclass +++ b/eclass/virtualx.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2018 Gentoo Foundation +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: virtualx.eclass @@ -178,7 +178,10 @@ virtx() { # Xvfb is started, else bump the display number # # Azarah - 5 May 2002 - XDISPLAY=$(i=0; while [[ -f /tmp/.X${i}-lock ]] ; do ((i++));done; echo ${i}) + # GNOME GDM may have started X on DISPLAY :0 with a + # lock file /tmp/.X1024-lock, therefore start the search at 1. + # Else a leftover /tmp/.X1-lock will prevent finding an available display. + XDISPLAY=$(i=1; while [[ -f /tmp/.X${i}-lock ]] ; do ((i++));done; echo ${i}) debug-print "${FUNCNAME}: XDISPLAY=${XDISPLAY}" # We really do not want SANDBOX enabled here |