From Gentoo Wiki
Jump to: navigation, search

ConsoleKit was a framework for defining and tracking users, login sessions, and seats. ConsoleKit's primary function is to support multi-user setups. It also works for a single user, but offers no benefits compared to existing methods. There has been no activity in its repository since late 2017. elogind is the recommended replacement.

ConsoleKit is a D-Bus daemon and creates for each PAM session its own session. All applications in that session can make use of the permissions granted to this session. ConsoleKit determines if the session is local (created by a local user in contrast to users logged in over the network), and if the session is active (meaning it's the most recent session). Based on these distinctions, ConsoleKit assigns device file permissions (e.g. for audio, video and more) to the session. Other software like polkit also make use of these distinctions.

Fast user switching is a feature powered by ConsoleKit. When switching, device file permissions get changed to the new active user and applications in the old session get notified, so they can revoke grants based on ConsoleKit information.

ConsoleKit supports shutdown/reboot handling, so that only the local, active user can shutdown or reboot the system.

The planned multi-seat feature is not fully implemented. At the moment all local sessions are in Seat1, all other sessions are in Seat2.


This article assumes that D-Bus has been previously configured.



KERNEL Required options for ConsoleKit
General setup --->
      [*] Auditing support
      [*] Enable system-call auditing support

USE flags

ConsoleKit support can be enabled system-wide by setting the USE flag to consolekit. The desktop profiles implicitly enable ConsoleKit.

FILE /etc/portage/make.conf

USE flags for sys-auth/consolekit Framework for defining and tracking users, login sessions and seats

acl Add support for Access Control Lists
cgroups Use the kernel to track processes instead of the session cookie.
debug Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see
doc Add extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally
evdev For handling VT switching with a session controller.
pam Add support for PAM (Pluggable Authentication Modules)DANGEROUS to arbitrarily flip
pm-utils Adds support for suspend/resume using sys-power/pm-utils
policykit Use the PolicyKit framework (sys-auth/polkit) to get authorization for suspend/shutdown.
selinux !!internal use only!! Security Enhanced Linux support, this must be set by the selinux profile or breakage will occur
test Enable dependencies and/or preparations necessary to run tests (usually controlled by FEATURES=test but can be toggled independently)
udev Enable virtual/udev integration (device discovery, power and storage device support, etc)


The system needs to be updated if the USE variable was set to consolekit:

root #emerge --ask --changed-use --deep @world


startx integration

To have a ConsoleKit session created when using startx to start the X server (instead of a display manager), add the following to each users ~/.xinitrc file:

FILE ~/.xinitrc
exec ck-launch-session dbus-launch --sh-syntax --exit-with-session <WINDOW_MANAGER>

WINDOW_MANAGER in the above example needs to be replaced by a window manager or a single application.


To start ConsoleKit:

root #/etc/init.d/consolekit start

To start ConsoleKit at boot:

root #rc-update add consolekit default


  • ck-list-sessions: Displays the details of all current sessions. For a local user, active and is-local should be TRUE.


  • Gentoo bugtracker: known bugs
  • ck-history: Use the --log parameter to display the logged messages.
  • The ConsoleKit init.d script /etc/init.d/consolekit uses the -q parameter to suppress debug messages. Remove this parameter and restart the service to get more messages. Use also the parameter --debug to get even more messages.
  • Since ConsoleKit communicates over D-Bus, D-Bus Troubleshooting may be of help.

console-kit-daemon already running

In some instances you may see the consolekit init script keeps failing, and say that it's already been running each time.

The reason for this is not always clear. The main suspect would be other init processes calling the daemon program before the it gets called.

To fix this, add consolekit to boot instead of default on init.


ConsoleKit creates XDG_RUNTIME_DIR as tmpfs. It does not specify size while mounting which yields the default from Kernel-code. Current default is half the physical RAM. See /usr/src/linux/Documentation/filesystems/tmpfs.txt. This is not an issue unless a user process starts to fill this file system. As an alternative elogind supports proper size limit.

See also

  • D-Bus — an interprocess communication (IPC) system for software applications.
  • elogind — the systemd project's logind, extracted to a standalone package. recommended replacement

External resources