Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 598615 - sys-auth/polkit: Add USE=elogind (was: sys-auth/polkit-0.113-r200 is invalid and should accept elogind)
Summary: sys-auth/polkit: Add USE=elogind (was: sys-auth/polkit-0.113-r200 is invalid ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Overlays (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo KDE team
URL:
Whiteboard: inOverlay
Keywords:
Depends on:
Blocks: elogind-support
  Show dependency tree
 
Reported: 2016-10-31 10:50 UTC by Sven Eden
Modified: 2017-01-14 19:36 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Fixes the ebuild and lets it accept elogind to substitute consolekit if !systemd is set. (update_polkit-ebuild.patch,1.02 KB, patch)
2016-10-31 10:50 UTC, Sven Eden
Details | Diff
Fixed ebuild patching in elogind support (polkit-0.113-r203.ebuild,3.36 KB, text/plain)
2016-11-04 07:35 UTC, Sven Eden
Details
Enable elogind package wide (polkit-enable-elogind.patch,5.48 KB, patch)
2016-11-04 07:41 UTC, Sven Eden
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Eden 2016-10-31 10:50:36 UTC
Created attachment 451975 [details, diff]
Fixes the ebuild and lets it accept elogind to substitute consolekit if !systemd is set.

I am currently trying to substitute ConsoleKit with elogind.

As a first step I tried to merge sys-auth/polkit-0.113-r200 with USE Flags:
  elogind jit kde nls pam -examples -gtk -introspection -selinux -systemd -test

The merge fails, as the ebuild is invalid according to portage-2.3.2.

Unfortunately, although elogind is pulled in, the original ebuild insist on pulling in consolekit if USE="-systemd" is set.
Comment 1 Johannes Huber (RETIRED) gentoo-dev 2016-11-01 10:12:23 UTC
There is already a elogind use flag. Maybe this should be optimized.
Comment 2 Sven Eden 2016-11-02 09:40:49 UTC
Well, I have succeeded in making "emerge --depclean" to remove sys-auth/consolekit from my system.

Further elogind now fully handles session tracking for my plasma desktop.

I had to update the following packages, all ebuilds available from my overlay "seden" for testing, but I am puzzling over what to do next.

Maybe a tracking bug would be a good idea? And where to put it all? [kde overlay] seems the logic place, as Plasma is what does make use of a singular logind substitute...

But then there are packages, that depend on sys-auth/consolekit if !systemd is set. (Like lxqt-base/lxqt-meta) What to do with those? As long as sys-auth/elogind is not in the tree, this seems difficult to decide...

Here is the list of packages I had to update so far:

--------
 ~ $ eix --nocolor -c -U elogind
[I] kde-plasma/powerdevil (5.8.3-r1(5)[3]@02.11.2016): Power management for KDE Plasma Shell
[I] sys-apps/accountsservice (0.6.42-r2[3]@01.11.2016): D-Bus interfaces for querying and manipulating user account information
[I] sys-auth/pambase (20150213-r1[3]@01.11.2016): PAM base configuration files
[I] sys-auth/polkit (0.113-r202[3]@01.11.2016): Policy framework for controlling privileges for system-wide services
[I] x11-base/xorg-server (1.18.4-r1(0/1.18.4)[3]@02.11.2016): X.Org X servers
[I] x11-misc/sddm (0.14.0-r2[3]@02.11.2016): Simple Desktop Display Manager
[1] "kde" /var/lib/layman/kde
[2] "qt" /var/lib/layman/qt
[3] "seden" /var/lib/layman/seden
--------

Note on xorg-server: If USE="systemd" is set, systemd-logind is used for (some?) session and fd handling. But the communication is done using dbus via org.freedesktop.login1, which is provided by elogind.

One warning though: Although my laptop is up and running fine, I have not yet tested everything.
Comment 3 Michael Palimaka (kensington) gentoo-dev 2016-11-02 12:53:44 UTC
Thanks for testing, it's really appreciated.

There's a few main reasons why I haven't pushed this further in the main tree yet:

1. I haven't been able to yet get working the other main feature I packaged elogind for - loginct unlock-session (needed for when the locker crashes)

2. I hit a nasty suspend loop with elogind installed

3. I don't really have an implementation plan. For this sort of package, I feel better about planning how we will integrate it with other packages before moving it to the main tree and everyone does their own thing
Comment 4 Sven Eden 2016-11-02 15:11:58 UTC
(In reply to Michael Palimaka (kensington) from comment #3)
> 1. I haven't been able to yet get working the other main feature I packaged
> elogind for - loginct unlock-session (needed for when the locker crashes)

I'll test it when locker crashes. If I lock Plasma normally it does not allow to get unlocked by loginctl. (Which is fine for me, as that would be an extreme security hole.)

> 
> 2. I hit a nasty suspend loop with elogind installed

I had that, too, and the fix for me was to add this to /etc/elogind/logind.conf:

--------
# Those are handled by PowerDevil
HandlePowerKey=ignore
HandleSuspendKey=ignore
HandleHibernateKey=ignore
HandleLidSwitch=ignore
--------

However, now that my PowerDevil no longer communicates with ConsoleKit, but with elogind I had to comment them out. Suspension works fine, with the only issue that Plasma does not lock itself on wakeup. (Another one for the list. ;-) )

> 
> 3. I don't really have an implementation plan. For this sort of package, I
> feel better about planning how we will integrate it with other packages
> before moving it to the main tree and everyone does their own thing

So maybe my idea with a tracking bug and testing in kde overlay is not as far fetched as I thought...
Comment 5 Sven Eden 2016-11-04 07:35:09 UTC
Created attachment 452306 [details]
Fixed ebuild patching in elogind support

This ebuild changes the following issues:

- The USE flags "elogind" and "systemd" are now mutually exclusive
- sys-auth/consolekit is only pulled in, if neither is set.
- Instead of sed'ing elogind into configure, a patch (follows) is applied
- The patch changes configure.ac and two Makefile.am files, so eautoreconf
  is called when USE="elogind" is set.
- Fixed "use_enable elogind" call.
- Replaced "systemd_with_unitdir" (deprecated) with
  --with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
Comment 6 Sven Eden 2016-11-04 07:41:00 UTC
Created attachment 452308 [details, diff]
Enable elogind package wide

This is the mentioned patch to the latest ebuild.

Down the line the patch does not result in anything different than the former sed'ing.

However, really patching in elogind support might lead to a point, once a complete patch is confirmed, where we could propose this upstream.
Comment 7 Sven Eden 2016-11-11 18:19:13 UTC
I have proposed the patch upstream:

https://bugs.freedesktop.org/show_bug.cgi?id=98688
Comment 8 Sven Eden 2016-12-06 08:49:36 UTC
@Freedesktop bugs : If you are fine with the ebuild as it, it might be ready for take over by the KDE Team. This variant is needed for elogind to be able to work at all (See Bug 599474) and both ebuilds are needed for the other ebuilds (see tracker at Bug 599470) to be added.

@KDE Team: If the Freedesktop Team is fine with this, you might want to take over for inclusion into the KDE overlay, substituting the current ebuild.
Comment 9 Andreas Sturmlechner gentoo-dev 2017-01-07 12:07:05 UTC
Thanks for your work! This is now in kde overlay.
Comment 10 Andreas Sturmlechner gentoo-dev 2017-01-14 19:36:40 UTC
Moved to tree as sys-auth/polkit-0.113-r2.