Bug 868685 - xorg-x11-xinit: "Error getting tty num"
xorg-x11-xinit: "Error getting tty num"
Product: Fedora
Classification: Fedora
Component: xorg-x11-xinit (Show other bugs)
i686 Linux
unspecified Severity high
: ---
: ---
Assigned To: X/OpenGL Maintenance List
Fedora Extras Quality Assurance
: Patch
Depends On: 806491
  Show dependency treegraph
Reported: 2012-10-21 14:06 EDT by Steve
Modified: 2013-05-20 19:27 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-05-20 19:27:43 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

  None (edit)
Description Steve 2012-10-21 14:06:36 EDT
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 13:28:45 EST
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 19:01:49 EDT
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 19:16:13 EDT
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}
    echo "Error getting tty num"
    exit 1

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 19:27:43 EDT
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.