Skip to content

Succeded into migrate Linux distro to ConsoleKit2. #94

@darkshram

Description

@darkshram

It's not an issue at all. Just wanted to share my experience if somebody else had issues migrating to ConsoleKit2. Took me several weeks of building, rebuilding, testing and reading. If there is an issue, it's probably that there is no documentation about how to setup a system to use properly ConsoleKit2, the only one available (o at least the only one I have found) is for programmers. So, I had to discover everything by myself.

The background: I maintain a SystemD-less Linux distro (ALDOS). It's sort-of based on Fedora and CentOS, and currently uses MATE Desktop 1.16, ConsoleKit 0.4.5, Upstart-1.13.2, udev-168 and upower 0.9.23. The plan for the next release was to migrate to MATE Desktop 1.18 (which uses ConsoleKit2 functions), Eudev 3.2.2, ConsoleKit2 1.0.2 and upower 0.99.4.

Built packages for eudev and ConsoleKit2 based on the spec files of udev and ConsoleKit. Made patches and lots of modifications until both eudev and ConsoleKit2 installed properly without reporting any errors in the syslog, running both in debug mode. Also repackaged util-linux with pam_ck_connector.so enabled in the login pam.d file. NOTE: The pam_ck_connector.so module must load only ONCE, so if it's included in /etc/pam.d/lightdm and /etc/lightdm-autologin, must be removed from there, otherwise will load twice after log-in from LightDM and will duplicate seats (the second without a tty) and therefore without privileges to shutdown, reboot, suspend, hibernate, etc.

Sessions were logged in /var/log/console. But I had a permissions issue with poweroff, reboot, suspend and hibernate: Dbus denied users access to ConsoleKit2. The suspects were polkit and dbus. After doing a lot of research & testing, it was lightdm package (backported from Fedora) the one to blame. Both /etc/pam.d/lightdm and /etc/pam.d/lightdm-autologin included pam_ck_connector.so, so every log-in was loading twice this module.

Everything started working perfectly after:

  1. Removing pam_ck_connector.so from the pam.d files from lightdm package.
  2. Also, the /etc/X11/xinit/xinitrc, /etc/X11/xinit/xinitrc-common and /etc/X11/xinit/Xsession files from back-ported xorg-x11-xinit package from Fedora have references to obsolete $CK_XINIT_SESSION. They can be removed because they are useless now, and under any circumstance must not be replaced with $CK_LAUNCH_SESSION because will do the same as loading twice pam_ck_connector.so (duplicate seats per user, user won't have permissions for many things). Just leave /etc/X11/xinit/xinitrc.d/90-consolekit as the only /etc/X11/xinit/* file using CK_LAUNCH_SESSION.

To make it short: ConsoleKit2 needs to be load pam_ck_connector.so only once (I used /etc/pam.d/login as the only file using it) and leave /etc/X11/xinit/xinitrc.d/90-consolekit as the only /etc/X11/xinit file using CK_LAUNCH_SESSION.

An advice to anyone upgrading pam: Only build pam with flex up to 2.6.0. Flex 2.6.1 and later versions will not allow to build pam 1.3.0.

I'm attaching the patches I used for ConsoleKit2 in a Fedora-based distro.
ConsoleKit2-files.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions