Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 505368 - sys-auth/consolekit-0.4.6 - consolekit ioctl fails during a VT_WAITACTIVE and fails to declare the current terminal as active
Summary: sys-auth/consolekit-0.4.6 - consolekit ioctl fails during a VT_WAITACTIVE and...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Jason Zaman
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2014-03-22 18:01 UTC by Jimmy.Jazz
Modified: 2016-04-10 16:55 UTC (History)
1 user (show)

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


Attachments
consolekit-0.4.6 ck-vt-monitor.c patch (consolekit-0.4.6-ck-vt-monitor.patch,2.66 KB, patch)
2014-03-22 18:03 UTC, Jimmy.Jazz
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jimmy.Jazz 2014-03-22 18:01:05 UTC
For whatever reason, consolekit ioctl fails during a VT_WAITACTIVE and fails to declare the current terminal as active.
The patch will care about it by reopening the console to check for the active terminal again.

Please find attached the patch for testing.

Reproducible: Always

Steps to Reproduce:
1. /usr/sbin/console-kit-daemon --no-daemon --debug
2. switch to console from X11 and from console to X11
3.
Actual Results:  
Error waiting for native console 7 activation: Input/output error

$ ck-list-sessions
Session2:
	unix-user = '1001'
	realname = 'user1'
	seat = 'Seat1'
	session-type = ''
	active = FALSE
	x11-display = ':0'
	x11-display-device = '/dev/tty7'
	display-device = '/dev/tty7'
	remote-host-name = ''
	is-local = TRUE
	on-since = '2014-03-22T17:29:50.778033Z'
	login-session-id = '1'


Expected Results:  
$ ck-list-sessions
Session2:
	unix-user = '1001'
	realname = 'user1'
	seat = 'Seat1'
	session-type = ''
	active = TRUE
	x11-display = ':0'
	x11-display-device = '/dev/tty7'
	display-device = '/dev/tty7'
	remote-host-name = ''
	is-local = TRUE
	on-since = '2014-03-22T17:29:50.778033Z'
	login-session-id = '1'


console-kit-daemon[22632]: DEBUG: Changing active VT: 1
console-kit-daemon[22632]: DEBUG: Creating thread for vt 7
console-kit-daemon[22632]: DEBUG: Active vt changed: 1
console-kit-daemon[22632]: DEBUG: Active device: /dev/tty1
console-kit-daemon[22632]: DEBUG: VT_WAITACTIVE for vt 7
console-kit-daemon[22632]: DEBUG: VT_WAITACTIVE for vt 7 returned -1
console-kit-daemon[22632]: DEBUG: Active session changed: (null)
console-kit-daemon[22632]: WARNING: Error waiting for native console 7 activation: Input/output error
console-kit-daemon[22632]: WARNING: Reopen a console and check again
console-kit-daemon[22632]: DEBUG: close descriptor 9
console-kit-daemon[22632]: DEBUG: Running programs in /etc/ConsoleKit/run-seat.d for action seat_active_session_changed
console-kit-daemon[22632]: DEBUG: VT_GETSTATE for vt 7
console-kit-daemon[22632]: DEBUG: Current VT: tty1
console-kit-daemon[22632]: DEBUG: VT 1:on
console-kit-daemon[22632]: DEBUG: VT 2:on
console-kit-daemon[22632]: DEBUG: VT 3:on
console-kit-daemon[22632]: DEBUG: Writing log for event: 1395509417.282 type=SEAT_ACTIVE_SESSION_CHANGED : seat-id='Seat1' session-id=''
console-kit-daemon[22632]: DEBUG: VT 4:on
console-kit-daemon[22632]: DEBUG: VT 5:on
console-kit-daemon[22632]: DEBUG: VT 6:on
console-kit-daemon[22632]: DEBUG: VT 7:on
console-kit-daemon[22632]: DEBUG: VT 8:off
console-kit-daemon[22632]: DEBUG: VT 9:off
console-kit-daemon[22632]: DEBUG: VT 10:off
console-kit-daemon[22632]: DEBUG: VT 11:off
console-kit-daemon[22632]: DEBUG: VT 12:on
console-kit-daemon[22632]: DEBUG: VT 13:off
console-kit-daemon[22632]: DEBUG: VT 14:off
console-kit-daemon[22632]: DEBUG: VT 15:off
console-kit-daemon[22632]: DEBUG: VT 16:off
console-kit-daemon[22632]: DEBUG: VT_WAITACTIVE for vt 7
console-kit-daemon[22632]: DEBUG: NameOwnerChanged: service_name=':1.18', old_service_name='' new_service_name=':1.18'
console-kit-daemon[22632]: DEBUG: CkManager: create session for sender: :1.18
console-kit-daemon[22632]: DEBUG: uid = 0
console-kit-daemon[22632]: DEBUG: pid = 25782
console-kit-daemon[22632]: DEBUG: Creating new session ssid: /org/freedesktop/ConsoleKit/Session3
console-kit-daemon[22632]: DEBUG: Setting override parameters for: unix-user
console-kit-daemon[22632]: DEBUG: Setting override parameters for: display-device
console-kit-daemon[22632]: DEBUG: Setting override parameters for: x11-display
console-kit-daemon[22632]: DEBUG: Setting override parameters for: x11-display-device
console-kit-daemon[22632]: DEBUG: Setting override parameters for: remote-host-name
console-kit-daemon[22632]: DEBUG: Setting override parameters for: is-local
console-kit-daemon[22632]: DEBUG: Executing /usr/lib/ConsoleKit/ck-collect-session-info --uid 0 --pid 25782
console-kit-daemon[22632]: DEBUG: Emitting completed
console-kit-daemon[22632]: DEBUG: Job status: 0
console-kit-daemon[22632]: DEBUG: Job output: unix-user = 0
display-device = /dev/tty1
login-session-id = 2

console-kit-daemon[22632]: DEBUG: CkManager: verifying session for leader
console-kit-daemon[22632]: DEBUG: Identified session '/org/freedesktop/ConsoleKit/Session3' as text
console-kit-daemon[22632]: DEBUG: Emitting added signal: /org/freedesktop/ConsoleKit/Session3
console-kit-daemon[22632]: DEBUG: Running programs in /etc/ConsoleKit/run-session.d for action session_added
console-kit-daemon[22632]: DEBUG: Running programs in /usr/lib/ConsoleKit/run-session.d for action session_added
console-kit-daemon[22632]: DEBUG: Allocated ChildData 0x14a2510
console-kit-daemon[22632]: DEBUG: Waiting for child with pid 26256
console-kit-daemon[22632]: DEBUG: In _child_watch for pid 26256
console-kit-daemon[22632]: DEBUG: Done waiting for child with pid 26256
console-kit-daemon[22632]: DEBUG: Freeing ChildData 0x14a2510
console-kit-daemon[22632]: DEBUG: Got uid: 1001
console-kit-daemon[22632]: DEBUG: Writing log for event: 1395509421.751 type=SEAT_SESSION_ADDED : seat-id='Seat1' session-id='Session3' session-type='' session-x11-display='' session-x11-d
console-kit-daemon[22632]: DEBUG: Active device: /dev/tty1
console-kit-daemon[22632]: DEBUG: Matched display-device /dev/tty1 to /org/freedesktop/ConsoleKit/Session3
console-kit-daemon[22632]: DEBUG: Active session changed: /org/freedesktop/ConsoleKit/Session3
console-kit-daemon[22632]: DEBUG: Running programs in /etc/ConsoleKit/run-seat.d for action seat_active_session_changed
console-kit-daemon[22632]: DEBUG: Running programs in /usr/lib/ConsoleKit/run-seat.d for action seat_active_session_changed
console-kit-daemon[22632]: DEBUG: Writing log for event: 1395509421.752 type=SEAT_ACTIVE_SESSION_CHANGED : seat-id='Seat1' session-id='Session3'
console-kit-daemon[22632]: DEBUG: Finalizing job
console-kit-daemon[22632]: DEBUG: NameOwnerChanged: service_name=':1.19', old_service_name='' new_service_name=':1.19'
console-kit-daemon[22632]: DEBUG: Removing sessions for service name: :1.19
console-kit-daemon[22632]: DEBUG: NameOwnerChanged: service_name=':1.19', old_service_name=':1.19' new_service_name=''
console-kit-daemon[22632]: DEBUG: VT_WAITACTIVE for vt 7 returned 0
console-kit-daemon[22632]: DEBUG: new descriptor is 9
console-kit-daemon[22632]: DEBUG: Pushing activation event for VT 7 onto queue
console-kit-daemon[22632]: DEBUG: Processing VT event queue
console-kit-daemon[22632]: DEBUG: Changing active VT: 7
console-kit-daemon[22632]: DEBUG: Creating thread for vt 1
console-kit-daemon[22632]: DEBUG: Active vt changed: 7
console-kit-daemon[22632]: DEBUG: Active device: /dev/tty7
console-kit-daemon[22632]: DEBUG: VT_WAITACTIVE for vt 1
console-kit-daemon[22632]: DEBUG: Matched display-device /dev/tty7 to /org/freedesktop/ConsoleKit/Session2
console-kit-daemon[22632]: DEBUG: Active session changed: /org/freedesktop/ConsoleKit/Session2
Comment 1 Jimmy.Jazz 2014-03-22 18:03:10 UTC
Created attachment 373274 [details, diff]
consolekit-0.4.6 ck-vt-monitor.c patch
Comment 2 Samuli Suominen (RETIRED) gentoo-dev 2014-03-23 05:06:37 UTC
(In reply to Jimmy.Jazz from comment #0)
> For whatever reason, consolekit ioctl fails during a VT_WAITACTIVE and fails
> to declare the current terminal as active.

With what version of dev-libs/glib? Have you seen bug 501330?

> The patch will care about it by reopening the console to check for the
> active terminal again.

You wrote the patch?
Did you open a corresponding bug at http://bugzilla.freedesktop.org/ against the ConsoleKit component?

> Please find attached the patch for testing.

Why is this patch suddently now needed, when it wasn't before? I don't like the idea of adding new features to CK in a form of a distribution patch (as opposed getting something reviewed and committed to the freedesktop.org git)
Comment 3 Jimmy.Jazz 2014-03-23 23:18:28 UTC
(In reply to Samuli Suominen from comment #2)
> (In reply to Jimmy.Jazz from comment #0)
> > For whatever reason, consolekit ioctl fails during a VT_WAITACTIVE and fails
> > to declare the current terminal as active.
> 
> With what version of dev-libs/glib? Have you seen bug 501330?

dev-libs/glib-2.38.2-r1 w/ linux 3.13.6

I don't use a session manager but openbox directly. The login is always working.

I'm using lightdm to connect to a login openbox 'session' and to shutdown the computer.

x11-misc/lightdm-1.9.6
x11-misc/lightdm-gtk-greeter-1.8.2

I'm using pam w/ the line: session  optional pam_ck_connector.so nox11
Consolekit never fails when I don't log to X.

lightdm right menu is working and I'm able to log out as expected
if I don't try to switch to a vt, return to the openbox session again and leave it for the lightdm greeter.

Also, if I switch to any of the Alt-Fx vt, the lightdm greeter doesn't allow me to use its menu again. Consolekit fails to activate the current session. Its log shows the message error.

With the patch, the failure disappear. 

I don't know about slim.

> 
> > The patch will care about it by reopening the console to check for the
> > active terminal again.
> 
> You wrote the patch?

Yes but it's hardly a patch.

> Did you open a corresponding bug at http://bugzilla.freedesktop.org/ against
> the ConsoleKit component?

No. The reason. I don't understand why the /dev/tty descriptor goes mad. The patch has no pretention. It closes and reopens the device and tries again.

> 
> > Please find attached the patch for testing.
> 
> Why is this patch suddently now needed, when it wasn't before? I don't like
> the idea of adding new features to CK in a form of a distribution patch (as
> opposed getting something reviewed and committed to the freedesktop.org git)

Believe me, it is needed on linux anyway. I don't know about BSD. Consolekit has never worked flawlessly. One time you loose the greeter menu, one time not.

Also the patch isn't a feature. It just helps to give the ability to get the right session activated after a failed VT_WAITACTIVATE ioctl and that every time :)
Comment 4 Jason Zaman gentoo-dev 2016-04-10 16:55:54 UTC
Does this still happen on the latest versions? please reopen if it does.