Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
What is the difference between elogind and consolekit ?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
javeree
Guru
Guru


Joined: 29 Jan 2006
Posts: 391

PostPosted: Mon Sep 09, 2019 12:11 pm    Post subject: What is the difference between elogind and consolekit ? Reply with quote

I may be completely off the mark here, but I think that consolekit and elogind are supposed to have the same goals, so that should mean that I should have only one of both running when I log in a desktop. There seems to be a choice, because there are USE flags for both consolekit and elogind?

The question is why should I want one over the other ?

First of all, it is not clear to me why I need any of those two. I have no idea what kind of functionality they activate. What is it that I as a user can/cannot do without them ?

Second, I have no idea when these functions are called and how they are configured (if there is a configuration). In order to have only one of both running (I use lxqt), is it sufficient to set the consolekit/elogind in make.conf ?

Finally, when there is a choice, what does elogind bring that consolekit does not and vice versa ?
Back to top
View user's profile Send private message
fedeliallalinea
Bodhisattva
Bodhisattva


Joined: 08 Mar 2003
Posts: 23553
Location: here

PostPosted: Mon Sep 09, 2019 2:07 pm    Post subject: Reply with quote

See https://unix.stackexchange.com/questions/435326/whats-the-difference-between-consolekit-and-elogind?answertab=active#tab-top

In gentoo elogind is required, if you use OpenRC, for some software like gnome, kde wayland, ...
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
pietinger
Tux's lil' helper
Tux's lil' helper


Joined: 17 Oct 2006
Posts: 95

PostPosted: Mon Sep 09, 2019 2:22 pm    Post subject: Reply with quote

I have an old installation with OpenRC and KDE and X. With this combination you can use consolekit (it is consolekit2) instead of elogind (like me).
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1787
Location: United Kingdom

PostPosted: Mon Sep 09, 2019 5:06 pm    Post subject: Reply with quote

javeree,

To answer your first question, you should only have one of them installed, i.e. either ConsoleKit or elogind.

To answer your second and third questions, if you want to use any of the following in Gentoo with OpenRC, you will need to use elogind rather than ConsoleKit:

- GNOME ( see https://blogs.gentoo.org/leio/2019/03/26/gnome-3-30/ )*
- Wayland in KDE
- Skype for Linux
- light-locker =>1.9.0 ( see https://forums.gentoo.org/viewtopic-t-1101032.html )

* As an alternative to GNOME in the main Portage tree, I believe Dantrell's patchset for Gentoo enbles the use of ConsoleKit for <= GNOME 3.22 and elogind for >= GNOME 3.24, but I do not use GNOME so have not tried these myself. Anyway, see the following for details:

https://forums.gentoo.org/viewtopic-t-1095396.html

https://wiki.gentoo.org/wiki/GNOME/GNOME_Without_systemd/Dantrell

When I was using ConsoleKit I had to patch lightdm-1.18.3 to get the Suspend button in the LightDM greeter to work, because the LightDM developers had not maintained LightDM to support ConsoleKit, although they subsequently committed a patch following my suggestion:

https://bugs.gentoo.org/605370

https://bugs.launchpad.net/lightdm/+bug/1631707

However, as I subsequently migrated to elogind I have not checked if Suspend and Hibernate now work from the LightDM greeter with newer versions of LightDM. (Suspend and Hibernate do work from the LightDM greeter with OpenRC+elogind).

I need to use Skype, including Skype-to-landline calls when overseas, and Skype for Linux no longer works with ConsoleKit, so I migrated to elogind.

The differences between ConsoleKit and logind that I have personally experienced in my two Gentoo installations since I migrated one year ago have been small -- see the following for details:

https://forums.gentoo.org/viewtopic-p-8267346.html#8267346

https://forums.gentoo.org/viewtopic-t-1094626-start-25.html

In answer to your third question, perhaps the Gentoo Wiki article on ConsoleKit might help:

https://wiki.gentoo.org/wiki/ConsoleKit

Gentoo Wiki wrote:
ConsoleKit is a framework for defining and tracking users, login sessions, and seats. ConsoleKit's primary function is to support multi-user setups. It also works for a single user, but offers no benefits compared to existing methods.

ConsoleKit is a D-Bus daemon and creates for each PAM session its own session. All applications in that session can make use of the permissions granted to this session. ConsoleKit determines if the session is local (created by a local user in contrast to users logged in over the network), and if the session is active (meaning it's the most recent session). Based on these distinctions, ConsoleKit assigns device file permissions (e.g. for audio, video and more) to the session. Other software like polkit also make use of these distinctions.

Fast user switching is a feature powered by ConsoleKit. When switching, device file permissions get changed to the new active user and applications in the old session get notified, so they can revoke grants based on ConsoleKit information.

ConsoleKit supports shutdown/reboot handling, so that only the local, active user can shutdown or reboot the system.

The planned multi-seat feature is not fully implemented. At the moment all local sessions are in Seat1, all other sessions are in Seat2.

as might the freedesktop article on systemd-logind, on which elogind is based:

https://freedesktop.org/wiki/Software/systemd/logind/

freedesktop.org wrote:
This is a tiny daemon that manages user logins and seats in various ways.

freedesktop.org wrote:
Please consult Multi-Seat on Linux for more information on the basic concepts.

See also this 2015 post by the person who created elogind:

https://lists.gnu.org/archive/html/guix-devel/2015-04/msg00352.html

Andy Wingo wrote:
Elogind is an attempt to
rip logind out of systemd. logind integrates with PAM to expose the
org.freedesktop.login1 interface over D-Bus. It also integrates with
polkit to let polkit know who is logged in at the console.
Gnome-session and gnome-settings-daemon both have logind integration of
some kind, using the d-bus interface, and actually the logind support is
necessary for basic things to work like backlight control and
suspend/resume.

You might also find the following of some help, as it discusses the functionality of ConsoleKit and logind (on which elogind is based):

https://davmac.wordpress.com/2015/09/03/d-bus-consolekit-policykit-turds-upon-turds-upon-turds/

In answer to your fourth question, this is how I installed elogind:

https://forums.gentoo.org/viewtopic-p-8265524.html#8265524

The combination of all the above answers may possibly answer your fifth question.

The original ConsoleKit code has not be touched since July 2013:

https://cgit.freedesktop.org/ConsoleKit/commit/

freedesktop.org wrote:
NOTE: ConsoleKit is no longer actively maintained and this will most
likely be the final release. You are advised to switch to logind:

http://www.freedesktop.org/software/systemd/man/systemd-logind.service.html

and ConsoleKit2, the fork that is used in Gentoo with OpenRC as the alternative to elogind, has not been touched since December 2017:

https://github.com/ConsoleKit2/ConsoleKit2

Basically, ConsoleKit is obsolete. Gentoo provides elogind as an alternative to ConsoleKit. My own feeling is that, due to the majority of distributions having adopted systemd, upstream developers of applications and utilities are not particularly interested in ConsoleKit[2] or in supporting it (as evidenced by my comments above on LightDM, light-locker and Skype for Linux). As elogind is more likely to work with newly-developed applications and the latest versions of existing applications, it made sense to me to switch from ConsoleKit to elogind even though I use OpenRC and have no interest at all in switching to systemd in Gentoo.
_________________
Clevo W230SS: amd64 nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC eudev elogind & KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 7480
Location: Austria

PostPosted: Mon Sep 09, 2019 6:07 pm    Post subject: Reply with quote

Not much more to add to that, except our elogind-support and elogind-default trackers - we are close to making elogind the default on desktop profiles.
_________________
backend.cpp:92:2: warning: #warning TODO - this error message is about as useful as a cooling unit in the arctic
Back to top
View user's profile Send private message
petr2008
n00b
n00b


Joined: 03 Jan 2008
Posts: 56
Location: Prague, cz

PostPosted: Mon Sep 09, 2019 6:44 pm    Post subject: Reply with quote

I have chosen consolekit for my installation.
Reading dmesg I was surprised to find:

Code:

[    7.946889] elogind-daemon[5834]: New seat seat0.
[    7.947501] elogind-daemon[5834]: Watching system buttons on /dev/input/event3 (Power Button)
[    7.967719] elogind-daemon[5834]: Watching system buttons on /dev/input/event1 (Power Button)
[    7.969593] elogind-daemon[5834]: Watching system buttons on /dev/input/event0 (Lid Switch)
[    7.969671] elogind-daemon[5834]: Watching system buttons on /dev/input/event2 (Sleep Button)
[    8.005771] elogind-daemon[5834]: Watching system buttons on /dev/input/event6 (Intel HID events)
[    8.005805] elogind-daemon[5834]: Watching system buttons on /dev/input/event7 (Intel HID 5 button array)
[    8.020801] elogind-daemon[5834]: Watching system buttons on /dev/input/event5 (AT Translated Set 2 keyboard)


I have consolekit in default of rc-update and

rc-service consolekit status
* status: started
rc-service elogind status
* status: stopped

It seems that elogind started by default at boot just to be switched to consolekit ?

Another issue.
I use lightdm and xfce with autologin. I am using also evolution and possibly
because of it I am getting annoying "unlock keyring" box after autologin.
Would migration from consolekit to elogind help me?


Last edited by petr2008 on Wed Sep 11, 2019 5:34 pm; edited 1 time in total
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1787
Location: United Kingdom

PostPosted: Tue Sep 10, 2019 9:26 am    Post subject: Reply with quote

petr2008 wrote:
I have consolekit in default of rc-update and

rc-service consolekit status
* status: started
rc-service elogind status
* status: stopped

It seems that elogind started by default at boot just to be switched to consolekit ?

You cannot have them both installed simultaneously. D-Bus will try to launch them even if they are not added to a runlevel, so you must remove the one you are not using, otherwise they will cause problems due to incompatibilities:

If you are using elogind:

a) In /etc/portage/make.conf
Code:
USE="-consolekit elogind -systemd"

b) Uninstall consolekit (if 'emerge -uvDN @world' followed by 'emerge --ask --depclean' did not remove it):
Code:
emerge --ask --depclean consolekit


If you are using ConsoleKit:

a) In /etc/portage/make.conf
Code:
USE="consolekit -elogind -systemd"

b) Uninstall elogind (if 'emerge -uvDN @world' followed by 'emerge --ask --depclean' did not remove it):
Code:
emerge --ask --depclean elogind

_________________
Clevo W230SS: amd64 nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC eudev elogind & KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 2650
Location: Canada

PostPosted: Tue Sep 10, 2019 11:03 am    Post subject: Reply with quote

One thing to add

I am running sddm, and on my laptop it refuses to start if elogind is already running. It launches it itsef if it is not present, but if it is I am not getting login screen.

So I have to be careful to

1) Not launch elogind as a service
2) If I shut off sddm (and it sometimes happen that I need to do /etc/init.d/xdm stop), I need to manually kill elogind instance (because it is not stopped by /etc/init.d/xdm stop) before restarting sddm.

Did not investigate why is it so. elogind I need for skypeforlinux
Back to top
View user's profile Send private message
depontius
Advocate
Advocate


Joined: 05 May 2004
Posts: 3423

PostPosted: Tue Sep 10, 2019 1:19 pm    Post subject: Reply with quote

I'm using sddm, and run elogind as a service at the boot runlevel, and am not having this problem

There is a slightly different problem with sddm that you might be seeing. It wants entropy in order to start, and sometimes the system doesn't have enough entropy on its own. I was finding this a while back, and if sddm is not coming right up, jiggling the mouse to generate additional entropy helps.
_________________
.sigs waste space and bandwidth
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1787
Location: United Kingdom

PostPosted: Tue Sep 10, 2019 3:56 pm    Post subject: Reply with quote

My Compal NBLB2 laptop (Gentoo ~amd64, SDDM, ATI Mobility Radeon HD 5650 GPU) suffers from a similar (the same?) problem as dmpogo. This happens if elogind is not added to any runlevel (so D-Bus starts it), and also if elogind is added to a runlevel. Cold and warm booting work fine in either case, but re-starting XDM from the command line in a terminal window within the Desktop Environment results in a blank screen with the cursor blinking in the top left corner. However, running the following Bash script from the command line in a terminal window in the DE enables me to restart XDM successfully:

Code:
#!/bin/bash
# For use to restart xdm from within the Desktop Environment
# in an installation that uses OpenRC+elogind.
# See https://forums.gentoo.org/viewtopic-t-1086741.html
#
# 1. Open a terminal window in the Desktop Environment.
# 2. Enter the command ./xdmrestart.sh
# 3. When prompted, enter your user account password.
#
echo "Enter your user account password."
sudo openvt -s -w /etc/init.d/xdm restart


Alternatively, if I use Ctrl+Alt+F<n> to switch to a TTY, I can login as root on a TTY and enter '/etc/init.d/xdm restart', which results in the laptop displaying the SDDM login screen on TTY7 and I can login successfully.
_________________
Clevo W230SS: amd64 nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC eudev elogind & KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
petr2008
n00b
n00b


Joined: 03 Jan 2008
Posts: 56
Location: Prague, cz

PostPosted: Wed Sep 11, 2019 5:45 pm    Post subject: Reply with quote

I changed to elogind from consolekit. Unfortunately, it did not solve
any of my little problems.

Using lightdm, xfce and networkmanager, changes are:

1) network manager does not connect automatically to known wifi (it
did before)

2) network manager keeps connected to wifi after logout and login to
xfce as another user (it did not before)

Persisting problems:

1) problem with large uid persists
(see https://forums.gentoo.org/viewtopic-t-1100674-highlight-.html)

But now I can login as a user with normal uid connect to wifi, logout
and login again to xfce as a user with large uid. It is more
comfortable workaround than "su -l" in the terminal.

2) Annoying "unlock keyring" box after autologin to xfce persists.
Surprisingly it does not show up when I login to xfce normally (without
autologin).
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 2650
Location: Canada

PostPosted: Thu Sep 12, 2019 10:13 am    Post subject: Reply with quote

Fitzcarraldo wrote:
My Compal NBLB2 laptop (Gentoo ~amd64, SDDM, ATI Mobility Radeon HD 5650 GPU) suffers from a similar (the same?) problem as dmpogo. This happens if elogind is not added to any runlevel (so D-Bus starts it), and also if elogind is added to a runlevel. Cold and warm booting work fine in either case, but re-starting XDM from the command line in a terminal window within the Desktop Environment results in a blank screen with the cursor blinking in the top left corner. However, running the following Bash script from the command line in a terminal window in the DE enables me to restart XDM successfully:

Code:
#!/bin/bash
# For use to restart xdm from within the Desktop Environment
# in an installation that uses OpenRC+elogind.
# See https://forums.gentoo.org/viewtopic-t-1086741.html
#
# 1. Open a terminal window in the Desktop Environment.
# 2. Enter the command ./xdmrestart.sh
# 3. When prompted, enter your user account password.
#
echo "Enter your user account password."
sudo openvt -s -w /etc/init.d/xdm restart


Alternatively, if I use Ctrl+Alt+F<n> to switch to a TTY, I can login as root on a TTY and enter '/etc/init.d/xdm restart', which results in the laptop displaying the SDDM login screen on TTY7 and I can login successfully.



There is a difference with my case. I never tried to restrart xdm (sddm) from within DE. I always switch to TTY, login as root. And then ./etc/init.d/xdm restart does not work (yes, blinking cursor in the corner), unless elogind process is killed before that.
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1787
Location: United Kingdom

PostPosted: Thu Sep 12, 2019 5:38 pm    Post subject: Reply with quote

dmpogo,

Curious. Have you tried something like the following as root user?:

Code:
loginctl terminate-user dmpogo && rc-service xdm restart

or the following from a TTY if you have logged out:
Code:
loginctl terminate-user sddm && rc-service xdm restart


That method works on my laptop that has OpenRC+elogind+SDDM.
_________________
Clevo W230SS: amd64 nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC eudev elogind & KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 2650
Location: Canada

PostPosted: Sun Sep 15, 2019 8:25 pm    Post subject: Reply with quote

Fitzcarraldo wrote:
dmpogo,

Curious. Have you tried something like the following as root user?:

Code:
loginctl terminate-user dmpogo && rc-service xdm restart

or the following from a TTY if you have logged out:
Code:
loginctl terminate-user sddm && rc-service xdm restart


That method works on my laptop that has OpenRC+elogind+SDDM.


Thanks I'll try when I get to that machine
Back to top
View user's profile Send private message
Prof. Frink
Apprentice
Apprentice


Joined: 07 Jan 2017
Posts: 176

PostPosted: Fri Oct 04, 2019 8:35 am    Post subject: Reply with quote

I use elogind with openrc, works nice.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum