Difference between revisions of "ConsoleKit"

From ArchWiki
Jump to: navigation, search
(Removed all of the outdated material. Note: savage edit!)
Line 6: Line 6:
 
''[http://www.freedesktop.org/wiki/ConsoleKit ConsoleKit] is not actively maintained. The focus has shifted to the built-in seat/user/session management of [http://www.freedesktop.org/wiki/Software/systemd systemd] called [http://0pointer.de/public/systemd-man/systemd-loginctl.html systemd-loginctl].''}}
 
''[http://www.freedesktop.org/wiki/ConsoleKit ConsoleKit] is not actively maintained. The focus has shifted to the built-in seat/user/session management of [http://www.freedesktop.org/wiki/Software/systemd systemd] called [http://0pointer.de/public/systemd-man/systemd-loginctl.html systemd-loginctl].''}}
  
{{out of date|This entire article needs to be updated for the 2012-10-30 news announcement: https://www.archlinux.org/news/consolekit-replaced-by-logind/ }}
+
See the 2012-10-30 news announcement: https://www.archlinux.org/news/consolekit-replaced-by-logind/
  
ConsoleKit is a framework for managing user sessions and permissions. Some of the most common usages of ConsoleKit are allowing non-root users to mount removable media and suspending/shutting down the computer through common desktop applications (e.g. [[Thunar]], Nautilus, the [[GNOME]] shutdown menu, etc.).
+
If you are looking for a convenient way to mount disks as user, have a look at [[udev]], [[udiskie]] and [[PolicyKit]]. You need to strongly consider switching to [[systemd]].
  
If you mind using an unmaintained application and you only want a convenient way to mount disks as user, have a look at [[udev]], [[udiskie]] and [[PolicyKit]]. You need to strongly consider switching to [[systemd]].
+
== Arch Repositories ==
 
+
== Installation ==
+
 
ConsoleKit is no longer packaged in the [[Official Repositories|official repositories]] [https://www.archlinux.org/news/consolekit-replaced-by-logind/]. It is '''strongly discouraged''' to continue to use or to start using ConsoleKit.
 
ConsoleKit is no longer packaged in the [[Official Repositories|official repositories]] [https://www.archlinux.org/news/consolekit-replaced-by-logind/]. It is '''strongly discouraged''' to continue to use or to start using ConsoleKit.
  
Line 24: Line 22:
  
 
  $ loginctl show-session $XDG_SESSION_ID
 
  $ loginctl show-session $XDG_SESSION_ID
 
== Display manager usage==
 
 
=== ck-launch-session ===
 
To launch an X session with ConsoleKit, append the following to the {{ic|exec}} statement in {{ic|~/.xinitrc}} e.g.:
 
 
exec ck-launch-session openbox-session
 
 
This starts [[Openbox]] with proper environment variables so it and its children are able to use ConsoleKit.
 
 
[[Display Manager|Display managers]] like [[KDM]], [[GDM]], [[LXDM]] and [[SLiM]] start ConsoleKit automatically with each X session.
 
 
{{Note|
 
*Do not nest ConsoleKit sessions by calling one from another, or you will break ConsoleKit.
 
*In particular, since [[SLiM]] reads {{ic|~/.xinitrc}}, you should make sure ''not'' to run {{ic|ck-launch-session}} there.
 
}}
 
 
=== Running several applications from ~/.xinitrc ===
 
 
If several applications are to be executed from {{ic|~/.xinitrc}}, not all of these will have ConsoleKit environment variables set. In the following example, only children of Compiz will be able to properly use ConsoleKit, but children of xterm will not.
 
 
{{hc|~/.xinitrc|
 
xterm &
 
exec ck-launch-session compiz ccp
 
}}
 
 
Typically, this can be an issue when for example using Compiz standalone and some other application launchers, (gnome-do, kupfer, gmrun, xbindkeys, etc.) since children of the application launcher will not be able to use ConsoleKit. A dirty workaround is to have the entire session started by a second script, e.g. {{ic|~/.xstart}}. Do not forget dbus-launch, it is likely that you will need it too:
 
 
{{hc|~/.xinitrc|
 
exec ck-launch-session dbus-launch ~/.xstart
 
}}
 
 
{{hc|~/.xstart|
 
xterm &
 
thunar &
 
compiz ccp
 
}}
 
 
Do not forget to make {{ic|~/.xstart}} executable:
 
 
$ chmod +x ~/.xstart
 
 
To see whether everything is started correctly:
 
 
$ ck-list-sessions
 
 
It should show at least one session like this one:
 
 
Session18:
 
        unix-user = '1000'
 
        realname = 'Your Name'
 
        seat = 'Seat1'
 
        session-type = ''
 
        active = TRUE
 
        x11-display = ':0'
 
        x11-display-device = '/dev/tty2'
 
        display-device = '/dev/tty1'
 
        remote-host-name = ''
 
        is-local = TRUE
 
        on-since = '2011-11-16T12:01:50.104764Z'
 
        login-session-id = '7'
 
 
=== No display manager ===
 
 
If you are not using a display manager, but starting your window manager via the {{ic|startx}} command, or from [[inittab]].
 
 
If ConsoleKit is not working ({{ic|ck-list-sessions}} command showing active = FALSE), you should start your window manager using the bash_profile method: [[Start_X_at_Login#bash_profile]].
 
 
== Use D-Bus for power operations ==
 
*shut down:
 
{{bc|1=dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop}}
 
*restart:
 
{{bc|1=dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart}}
 
*suspend:
 
{{bc|1=dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Suspend}}
 
*hibernate (suspend to disk):
 
{{bc|1=dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Hibernate}}
 
 
This method assumes that you are given permission to shut the system down via PolicyKit. The default group for this is {{ic|wheel}}. To change this, edit {{ic|/etc/polkit-1/localauthority.conf.d/50-localauthority.conf}} as root.
 
 
{{Note|Using D-Bus for suspend and hibernate requires {{Pkg|upower}}.}}
 
 
== More resources ==
 
* [https://bbs.archlinux.org/viewtopic.php?id=116853  ck-launch-session, Compiz, and mounting in Thunar/udisks]
 

Revision as of 07:59, 20 March 2013

Warning: From ConsoleKit's web site:
ConsoleKit is not actively maintained. The focus has shifted to the built-in seat/user/session management of systemd called systemd-loginctl.

See the 2012-10-30 news announcement: https://www.archlinux.org/news/consolekit-replaced-by-logind/

If you are looking for a convenient way to mount disks as user, have a look at udev, udiskie and PolicyKit. You need to strongly consider switching to systemd.

Arch Repositories

ConsoleKit is no longer packaged in the official repositories [1]. It is strongly discouraged to continue to use or to start using ConsoleKit.

Replacing ConsoleKit with systemd-logind

Note: Starting with polkit 0.107-4, ConsoleKit must be completely replaced by systemd-logind[2], even when using a display manager. The system must be booted with systemd to be fully functional.

An easy method to be able to remove ConsoleKit is to automatically log in to a virtual console and start X from there. It is important that, as mentioned in the latter article, the X server is started on the same virtual console that you log in to, otherwise logind can not keep track of the user session. You can then simply remove ck-launch-session from your ~/.xinitrc.

In order to check the status of your user session, you can use loginctl. To see if your user session is properly set up, check if the following command contains Active=yes. All PolicyKit actions like suspending the system or mounting external drives with Udisks should then work automatically.

$ loginctl show-session $XDG_SESSION_ID