Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Succeded into migrate Linux distro to ConsoleKit2. #94
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:
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.