Gentoo Archives: gentoo-catalyst

From: "W. Trevor King" <wking@×××××××.us>
To: Catalyst <gentoo-catalyst@l.g.o>
Cc: "W. Trevor King" <wking@×××××××.us>
Subject: [gentoo-catalyst] [PATCH v2 1/2] livecd-bashrc: Avoid a startx race by restricting to tty1
Date: Wed, 06 Mar 2013 17:03:24
Message-Id: 1fdbc0e92ed3309eeadb43c3768ec3d1e74fbf25.1362589155.git.wking@tremily.us
In Reply to: [gentoo-catalyst] [PATCH v2 0/2] Fix livecdfs-update.sh startx handling by "W. Trevor King"
1 From: "W. Trevor King" <wking@×××××××.us>
2
3 Otherwise several virtual consoles may notice the existence of
4 /etc/startx, and spawn simultaneous X servers. This way we only spawn
5 a single X server, regardless of timing.
6
7 A better solution here is probably to add a "start" or "x-server"
8 service to /etc/init.d/, but that's more work than I'm up to at the
9 moment.
10 ---
11 livecd/files/livecd-bashrc | 2 +-
12 1 file changed, 1 insertion(+), 1 deletion(-)
13
14 diff --git a/livecd/files/livecd-bashrc b/livecd/files/livecd-bashrc
15 index 983e657..7abfbd4 100644
16 --- a/livecd/files/livecd-bashrc
17 +++ b/livecd/files/livecd-bashrc
18 @@ -4,7 +4,7 @@ if [ ! "$(grep nox /proc/cmdline)" ]
19 then
20 if [ -x /usr/bin/X ]
21 then
22 - if [ -e /etc/startx ]
23 + if [ -e /etc/startx ] && [ "$(tty)" == /dev/tty1 ]
24 then
25 rm -f /etc/startx
26 ##STARTX
27 --
28 1.8.2.rc0.16.g20a599e