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] livecd-bashrc: Avoid a startx race by restricting to tty1
Date: Mon, 04 Mar 2013 03:13:39
Message-Id: 6d3c93bde552943c26acbf6c1946dae23821860c.1362366795.git.wking@tremily.us
In Reply to: [gentoo-catalyst] [PATCH] livecdfs-update.sh: Escape ampersands in STARTX sed expression 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

Replies