Bug 868685 - xorg-x11-xinit: "Error getting tty num"
Summary: xorg-x11-xinit: "Error getting tty num"
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: xorg-x11-xinit
Version: 17
Hardware: i686
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: X/OpenGL Maintenance List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 806491
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-10-21 18:06 UTC by Steve
Modified: 2013-05-20 23:27 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-05-20 23:27:43 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Patch for FC18 (782 bytes, patch)
2013-05-20 23:01 UTC, Steve
no flags Details | Diff

Description Steve 2012-10-21 18:06:36 UTC
As of xorg-x11-xinit-1.3.2-7.fc17 (which I got via "yum update" on Friday 19-Oct-2012), typing "startx" at the console (i.e. when booting the machine with run-level 3) prints "Error getting tty num" and exits.  "telinit 5" works fine.

I was able to fix the problem by rebuilding the xorg-x11-xinit package from source (i.e. "yumdownloader --source xorg-x11-xinit") and modifying line 16 of xorg-x11-xinit-1.3.2-systemd-logind.patch .

Before, it read:

+if [ x"$tty_num" != x ]; then

In my fixed version, it reads:

+if [ x"$tty_num" == x ]; then

The commit that led to this problem is described at http://lists.fedoraproject.org/pipermail/scm-commits/2012-October/872512.html .

Comment 1 Steve 2013-02-09 18:28:45 UTC
Soooo...is anyone going to apply this fix?
I just upgraded a computer from FC16 to FC17 and noticed that the old, bugged version was still in the yum repos.

Comment 2 Steve 2013-05-20 23:01:49 UTC
Created attachment 750754 [details]
Patch for FC18

Here's the patch for FC18.

So...is anyone ever going to apply this _extremely simple_ bug fix...?
Or am I just spamming the bug queue?

Comment 3 Rex Dieter 2013-05-20 23:16:13 UTC
So, I think folks in #fedora-devel conclude unanimously the proposed fix here is incorrect.

The code:

tty_num=$(tty | grep -oE '[0-9]+$')
...
if [ x"$tty_num" != x ]; then
    # Specify TTY number directly to avoid recognizing startx session as
    # inactive: RHBZ#820675
    serverargs=${serverargs}" vt"${tty_num}
else
    echo "Error getting tty num"
    exit 1
fi

The real problem is hitting the "Error getting tty num" case at all.  We need to know why/how the 'tty' call is ending up empty for you.

Comment 4 Steve 2013-05-20 23:27:43 UTC
Here's the key difference we just found:

"(tty>blah.txt)&" works
"(tty>blah.txt&)" doesn't

That seems like an odd inconsistency in the way bash handles background processes.

So, if anything, it's a bash issue, not an xorg-x11-xinit issue.

I'll shut up now. :-)


Note You need to log in before you can comment on or make changes to this bug.