Bug 868685

Summary: xorg-x11-xinit: "Error getting tty num"
Product: [Fedora] Fedora Reporter: Steve <ulatekh>
Component: xorg-x11-xinitAssignee: X/OpenGL Maintenance List <xgl-maint>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 17CC: rdieter, xgl-maint
Target Milestone: ---Keywords: Patch
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-05-20 23:27:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 806491    
Bug Blocks:    
Attachments:
Description Flags
Patch for FC18 none

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. :-)