Bug 359361 - ConsoleKit tries to find the console using keyboard ioctls that don't always work
Summary: ConsoleKit tries to find the console using keyboard ioctls that don't always ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: ConsoleKit
Version: rawhide
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: David Zeuthen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 366981 429157 (view as bug list)
Depends On:
Blocks: F8Target
TreeView+ depends on / blocked
 
Reported: 2007-10-30 22:45 UTC by Peter Jones
Modified: 2013-03-06 03:53 UTC (History)
4 users (show)

Fixed In Version: 0.2.3-3.fc8.1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-03-01 09:28:11 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
patch to use VT_ETSTATE and tty0 (1.32 KB, patch)
2007-10-30 22:45 UTC, Peter Jones
no flags Details | Diff

Description Peter Jones 2007-10-30 22:45:58 UTC
Description of problem:  ConsoleKit tries to find a valid fd it can issue
VT_WAITACTIVE against by iterating across a file list and issuing 
ioctl(fd, KDGKBTYPE, &arg), then checking the return value.  Not all console
devices support this ioctl, so in some cases it never finds a valid file
descriptor to use, and from then on never marks any session active.

We probably ought to be using something like VT_GETSTATE instead of a keyboard
ioctl, but that's not sufficient to fix it.  One fix that seems to work, though
I'm not completely sure if it's the best answer, is to add /dev/tty0 to the list
of files to try before /dev/console.

I've attached a patch that seems to resolve the issue for me.

Comment 1 Peter Jones 2007-10-30 22:45:58 UTC
Created attachment 243861 [details]
patch to use VT_ETSTATE and tty0

Comment 2 Peter Jones 2007-10-31 14:34:38 UTC
(Comment #1 should say VT_GETSTATE, of course)

Comment 3 Lubomir Kundrak 2007-12-03 13:51:06 UTC
Raising priority to high, keeping track of active sessions is fairly important.
Furthermore the fix is attached to this problem.

I found this issue while determining why was my desktop user unable to hibernate
a machine. This fix fixes the problem for me. The workaround was to run the
consolekit daemon with --no-daemon option which caused it to find the active tty
correctly.

Comment 4 David Zeuthen 2007-12-03 19:07:44 UTC
Sorry this bug got lost for me. Jon, what do you think? Thanks.

Comment 5 jmccann 2007-12-03 19:14:49 UTC
Hi, sorry for the lag.  I think this looks reasonable.  I'll test and commit
this as soon as I get my development machine back up (hopefully in the next few
days).  Thanks.

Comment 6 jmccann 2007-12-09 04:04:43 UTC
In git now.  Thanks for the patch Peter.

Comment 7 Lubomir Kundrak 2008-01-19 14:12:43 UTC
I'm wondering if there's a chance that ConsoleKit update will occur for Fedora
8. In case yes, this fix is a good candidate to be included :)

Comment 8 Lubomir Kundrak 2008-02-29 19:39:15 UTC
*** Bug 429157 has been marked as a duplicate of this bug. ***

Comment 9 Fedora Update System 2008-03-01 09:28:07 UTC
ConsoleKit-0.2.3-3.fc8.1 has been pushed to the Fedora 8 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Lubomir Kundrak 2008-03-18 15:31:42 UTC
*** Bug 366981 has been marked as a duplicate of this bug. ***


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