Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 481236 - LiveCD tries to start X once for every tty
Summary: LiveCD tries to start X once for every tty
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: Catalyst (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Catalyst Developers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-16 01:32 UTC by Tom Stellard
Modified: 2013-10-26 20:11 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch (0001-Start-the-X-server-only-once.patch,725 bytes, patch)
2013-09-25 22:28 UTC, Matt Turner
Details | Diff
patch 1 (0001-Revert-livecdfs-update.sh-Escape-ampersands-in-START.patch,904 bytes, patch)
2013-10-11 22:08 UTC, Matt Turner
Details | Diff
patch 2 (0002-livecd-bashrc-Avoid-a-startx-race-by-restricting-to-.patch,806 bytes, patch)
2013-10-11 22:08 UTC, Matt Turner
Details | Diff
patch 3 (0003-livecdfs-update.sh-Use-bash-login-to-spawn-startx.patch,3.26 KB, patch)
2013-10-11 22:09 UTC, Matt Turner
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Stellard 2013-08-16 01:32:58 UTC
The livecd/files/livecd-bashrc file which is copied to /root/.bashrc contains shell code for starting X on login.  However, the mechanism it uses to test whether X has already started is not very robust and can result in X being started at the same time on multiple ttys, since each tty is configured for auto-login.

This occasionally causes a blank screen to be displayed to the user rather than the LiveCD's window manager.

Reproducible: Always
Comment 1 Tom Stellard 2013-08-22 03:23:34 UTC
I think putting something like this in .bashrc may work:

if [ "$(tty)" = "/dev/tty1" ] ; then
  su -u gentoo -c startx
fi
Comment 2 Matt Turner gentoo-dev 2013-09-25 22:28:59 UTC
Created attachment 359492 [details, diff]
patch

Give this a try.
Comment 3 Tom Stellard 2013-09-30 14:35:29 UTC
(In reply to Matt Turner from comment #2)
> Created attachment 359492 [details, diff] [details, diff]
> patch
> 
> Give this a try.

I've done a lot of testing with this patch, and here is what I've discovered:

1. Starting X on /dev/tty7 does not seem to work.  Using /dev/tty1 and /dev/tty6 worked fine, and I'm assuming any tty in between will work too, but I haven't tested this.

2. Starting X on /dev/tty1 and /dev/tty6 works, but the VT does not automatically switch to tty8 where X was launched.  I needed to do this manually using ctrl+alt+F8

I was able to get the VT to switch automatically by inserting sleep 5 right before the su command which launched X

I would be happy with the the start on /dev/tty6 + sleep 5 solution, even though it is kind of a hack.
Comment 4 Matt Turner gentoo-dev 2013-10-11 22:08:39 UTC
Created attachment 360668 [details, diff]
patch 1
Comment 5 Matt Turner gentoo-dev 2013-10-11 22:08:52 UTC
Created attachment 360670 [details, diff]
patch 2
Comment 6 Matt Turner gentoo-dev 2013-10-11 22:09:09 UTC
Created attachment 360672 [details, diff]
patch 3

Give these a try.
Comment 7 Matt Turner gentoo-dev 2013-10-26 20:11:05 UTC
Committed.