console-kit-daemon(1m)

✨ NAME ✨

okay bestie, gather round πŸ’– this is console-kit-daemon β€” literally the ConsoleKit daemon, the main character of session tracking. that's the whole name. slay.


πŸ¦‹ SYNOPSIS πŸ¦‹


🌸 DESCRIPTION 🌸

so console-kit-daemon is the service for defining and tracking users, login sessions and seats. it hands out the interfaces you need for switching sessions and for session migration when you're using mechanisms like Virtual Terminals (VT). ConsoleKit gives you a whole bunch of interfaces to say which displays are managed by the display manager, and how. no cap.

ConsoleKit keeps a database of which users are logged into the system, and it groups sessions by seats β€” a seat being a set of hardware (usually a keyboard and a mouse). other processes talk to ConsoleKit over D-Bus. that's the whole relationship, it's giving long-distance. 😌

one session leader process is the one responsible for asking console-kit-daemon to open a new session. in the typical case that session leader is a ConsoleKit-enabled display manager, like GDM. this leader connects to the D-Bus system bus and asks console-kit-daemon to open a session whenever it's needed.

if the operation succeeds, console-kit-daemon returns a cookie to the session leader. the session leader should store this variable in the environment as XDG_SESSION_COOKIE so it can be shared with its child processes. that environment variable holds the UUID used to tie processes to a session. iconic behavior tbh.

at this point the session is registered with ConsoleKit, and a particular set of information about the session gets stored along with it.

the Session stays open until the Session Leader disconnects from the D-Bus system bus. then the session is removed from its seat, and deregistered. it's giving ✨closure✨.

various other programs need to know info about running user sessions β€” think the Fast User Switch Applet and other mechanisms for switching the console to a different VT display. those programs use ConsoleKit interfaces to figure out if user switching is even supported, and to manage the switching of different sessions on the same seat.

ConsoleKit also provides a pam_ck_connector so that non-graphical logins (e.g. telnet, ssh, etc.) get registered with ConsoleKit. this works if that PAM module is enabled in the pam.conf(4) configuration. so ConsoleKit can be used as a utmp/wtmp replacement, because it stores a superset of the information found in the utmp/wtmp database. glow-up fr.

the ConsoleKit database is stored in the file /run/ConsoleKit/database. it stores information about active Seats, Sessions, and the current SessionLeader. πŸ‘‘


πŸ’… OPTIONS πŸ’…

the following options are supported:

  • --debug β€” turn on debug output. yes, more talking. we love that.
  • -h, --help β€” show the detailed usage message.
  • --no-daemon β€” don't start console-kit-daemon as a daemon. lowkey perfect for debugging.
  • --timed-exit β€” exit after 30 seconds. also super useful for debugging.

🌈 ENVIRONMENT VARIABLES 🌈

see environ(5) for the descriptions of environment variables, bestie.

  • DISPLAY β€” this one corresponds to the Xserver display value associated with the ConsoleKit session.
  • XDG_SESSION_COOKIE β€” ConsoleKit provides this environment variable to the session leader. the session leader is expected to make sure it's set for the session process that gets started. it contains a UUID used to tie the processes to the session. this is what supports user switching on displays that support it (currently only graphical VT displays on the console).
  • XDG_RUNTIME_DIR β€” this defines the base directory where user-specific files and objects should be stored. the XDG_RUNTIME_DIR is the same for all sessions of the same user, and it gets automatically removed once the last session of that user is closed. bye bestie 🫢

the following environment variables get set when console-kit-daemon runs the run-seat.d scripts. these values correspond to the values returned by the ck-list-session(1) utility.

  • CK_SESSION_SEAT_ID β€” the seat ID associated with the session.
  • CK_SESSION_SEAT_UID β€” the user id associated with the session
  • CK_SESSION_DISPLAY_DEVICE β€” the display device associated with the session.
  • CK_SESSION_X11_DISPLAY_DEVICE β€” the value of the display device that the X11 display for the session is connected to. if there's no x11-display set, then this value is undefined.
  • CK_SESSION_X11_DISPLAY β€” the value of the X11 DISPLAY environment variable for this session, if one is present.
  • CK_SESSION_REMOTE_HOST_NAME β€” if the session isn't local, the value is the host name associated with the session. if the session is local, the value is empty.
  • CK_SESSION_IS_ACTIVE β€” the value is "TRUE" if the session is active on the seat it's attached to, and "FALSE" otherwise.
  • CK_SESSION_IS_LOCAL β€” the value is "TRUE" if the session is local, and "FALSE" if it's remote.
  • CK_SESSION_IS_DYNAMIC β€” the value is "TRUE" if the session was started with ck-seat-tool, and "FALSE" otherwise.

🧚 EXTENDED DESCRIPTION 🧚

πŸŽ€ ConsoleKit Seat Configuration πŸŽ€

ConsoleKit seat configuration files live in the /etc/ConsoleKit/seats.d directory. every seat configuration file ends with the .seat suffix. ConsoleKit ships a default seat file named 00-primary.seat, and you can add more seat configuration files on top of that. these files are in standard INI format.

the settings below are in "group/key=default_value" format, and they show the default values of the 00-primary.seat file. so for example, if you wanted to specify a different "Seat Entry/Name" value, you'd modify this file so it contains these lines:

[Seat Entry]
[...]
Name=Customized seat name

the following keys are supported for configuring ConsoleKit seats:

  • Seat Entry/Version=1.0 β€” version number of the seat file. this specifies the version number of the configuration file format being used. currently only the value "1.0" is supported.
  • Seat Entry/Name=Primary seat β€” name of the seat.
  • Seat Entry/ID=StaticSeat β€” specifies the unique ID of the seat. if the value is NULL, then console-kit-daemon will provide a value. the ID may only contain the ASCII characters [A-Z][a=z][0-9]_".
  • Seat Entry/Hidden=false β€” if this value is set to "false", then ConsoleKit will create this seat. otherwise, the seat will not be created.
  • Seat Entry/Devices β€” this value is not currently supported. in the future it's planned that ConsoleKit will provide the ability to manage how device permissions are managed, and this key is a placeholder for that.
  • Seat Entry/Sessions=Local β€” list of sessions to start on the seat, separated by the ";" character. each session must be defined in a ConsoleKit session configuration file named /etc/ConsoleKit/sessions.d/sessions.session, where sessions is the value of this key.

πŸ¦‹ ConsoleKit Session Configuration πŸ¦‹

ConsoleKit session configuration files live in the /etc/ConsoleKit/sessions.d directory. each session configuration file ends with the .session suffix. additional seat configuration files may be added. these files are in standard INI format.

the settings below are in "group/key" format, so to specify the "Session Entry/Name" value, the file should contain these lines:

[Session Entry]
[...]
Name=Customized Session

the following keys are supported for configuring ConsoleKit sessions:

  • Session Entry/Name β€” unique name of the session.
  • Session Entry/Type β€” type of the session
  • Session Entry/Description β€” description of the session.
  • Session Entry/DisplayTemplate β€” this specifies the display type to be used with the session. it corresponds to the file /etc/ConsoleKit/displays.d/display_template.display, where display_template is the value of this key.
  • Local/variable β€” the ConsoleKit display configuration file associated with the "Entry/DisplayTemplate" key specifies the command to run to launch the display. that command is defined in the ConsoleKit display configuration file under the key "X11/Exec". this command can include variables that begin with the "$" character, such as "$display". the values to be used for those variables can be defined in this section. so if the session configuration file contains the value "Local/display=:0", this will cause the variable used when launching the command to be replaced with the value "0". cute, right? variable substitution but make it ✨fashion✨.

πŸ’œ ConsoleKit System Restart and Stop πŸ’œ

console-kit-daemon provides D-Bus interfaces that will restart or stop the system. when console-kit-daemon receives a D-Bus request to restart the system, it will run the /usr/lib/ConsoleKit/scripts/ck-system-restart script β€” but only if the user has privilege to do this operation. when console-kit-daemon receives a D-Bus request to stop the system, it will run the /usr/lib/ConsoleKit/scripts/ck-system-stop script β€” again, only if the user has privilege to do this operation.

bestie this is the part where you check your privileges before you poke the system. permissions are not a suggestion. πŸ’€

⭐ EXAMPLES ⭐

Example 1: To start the ConsoleKit daemon

example% console-kit-daemon

Example 2: To configure ConsoleKit to start multiple sessions on a single seat

to start two local displays β€” DISPLAY ":0" on vt7 and DISPLAY ":1" on "vt8" β€” edit the 00-primary.seat file as follows:

[Seat Entry]
Version=1.0
Name=Primary seat
Description=start static displays :0 on vt7 and :1 on vt8
Hidden=false
Devices=
Sessions=Local;Local2;

then, in addition to the original /etc/ConsoleKit/sessions.d/Local.session file, add the following /etc/ConsoleKit/sessions.d/Local2.session file:

[Session Entry]
Name=Local
Type=LoginWindow
Description=Local Login Screen
DisplayTemplate=Local

[Local]
display=:1
vt=/dev/vt/8

πŸ“ SEE ALSO πŸ“

more information can be found at:

https://github.com/ConsoleKit2/ConsoleKit2

ck-history(1), ck-launch-session(1), ck-list-sessions(1), svcadm(1m), environ(5), smf(5), console(4)


πŸ‘‘ NOTES πŸ‘‘

Brian Cameron, Sun Microsystems Inc., 2009. Copyright (c) 2009 by Sun Microsystems, Inc.

some of the documentation in this manpage is from the ConsoleKit documentation written by William Jon McCann.


and that's the whole page, bestie 🫢 this was the console-kit-daemon maintenance-commands manual, straight outta SunOS 5.11, dated 24 Oct 2009 β€” yes it's a whole throwback era, but it still ate. periodt. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from