Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 764557 - =sys-auth/elogind-246.9.1: no seat assigned unless elogind added to boot runlevel (was: dbus is not working properly)
Summary: =sys-auth/elogind-246.9.1: no seat assigned unless elogind added to boot runl...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Andreas Sturmlechner
URL:
Whiteboard:
Keywords:
: 765460 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-01-09 08:39 UTC by lekto
Modified: 2021-01-15 16:54 UTC (History)
5 users (show)

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


Attachments
emerge --info (emerge.info,6.13 KB, application/x-info)
2021-01-09 08:39 UTC, lekto
Details
/var/log/messages (messages.txt,9.20 KB, text/plain)
2021-01-14 15:35 UTC, lekto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description lekto 2021-01-09 08:39:39 UTC
Created attachment 682039 [details]
emerge --info

Sound and also restarting and shutting down in xfce stopped working after I updated elogind. It looks similar to this: [1], but rc-service and ps -aufx confirmed that dbus is running. Downgrade elogind to 243.7-r1 fix issue.

[1] https://forums.gentoo.org/viewtopic-t-1125921-start-0-postdays-0-postorder-asc-highlight-.html
Comment 1 Jonas Stein gentoo-dev 2021-01-12 01:22:58 UTC
It is sad to read that you have problems with elogind. 
We need more details before I can assign the ticket to someone.


The situation seems to be a bit more complicate and requires some analysis.
We can not help you efficiently via bug tracker. The bug tracker aims rather on specific problems in .ebuilds and less on individual systems. 

I have had very good experience on the gentoo IRC [1] with questions like this. Of course there are also forums and mailing lists [2,3].
I hope you understand, that I will close the bug here therefore and wish you good luck on one of the mentioned channels [4].
Please reopen the ticket in order to provide an indication for an specific error in an ebuild or any gentoo related product.

[1] https://www.gentoo.org/get-involved/irc-channels/
[2] https://forums.gentoo.org/
[3] https://www.gentoo.org/get-involved/mailing-lists/all-lists.html
[4] https://www.gentoo.org/support/
Comment 2 lekto 2021-01-12 14:58:38 UTC
Okay, I just found out I need to add elogind to boot runlevel, this is weird because elogind should start automatically acording to this:
>elogind is currently not started from any runlevel.
>You may add it to the boot runlevel by:
># rc-update add elogind boot
>Alternatively, you can leave elogind out of any
>runlevel. It will then be started automatically
>when the first service calls it via dbus, or
>the first user logs into the system.
Other fix is just to relogin, so I think something (sddm or xfce) don't play well with elogind.
>[ebuild   R    ] x11-misc/sddm-0.18.1-r3::gentoo  USE="elogind pam -systemd -test" 3,324 KiB
>[ebuild   R    ] xfce-base/xfce4-meta-4.16::gentoo  USE="svg upower -minimal" 0 KiB

PS same with elogind-246.9.1-r1
Comment 3 Andreas Sturmlechner gentoo-dev 2021-01-12 15:02:17 UTC
Please try something:

In /etc/init.d/xdm, inside depend() function, search for this line:

> use consolekit dbus xfs
Replace consolekit with elogind.
Comment 4 lekto 2021-01-12 15:14:33 UTC
Nothing, still need to relogin to get working audio. I don't know if it's relatable, but I don't see elogind in rc-status.
Comment 5 Piotr Karbowski (RETIRED) gentoo-dev 2021-01-12 16:00:28 UTC
> because elogind should start automatically

elogind is automatically started by pam_elogind.so module. If your xdm of choice do not use PAM it will not start it.

After the reboot when your audio is not working, run 'loginctl list' and paste what you see there.
Comment 6 lekto 2021-01-12 17:06:30 UTC
After reboot:
>No sessions.
After relogin:
>SESSION  UID USER  SEAT  TTY
>      3 1000 lekto seat0    
> 
>1 sessions listed.
Comment 7 Piotr Karbowski (RETIRED) gentoo-dev 2021-01-12 17:38:04 UTC
The new elogind have change in init script that makes sue it starts after the logger. Can you try to reboot with old init script?

    cat "$(portageq get_repo_path / gentoo)/sys-auth/elogind/files/elogind.init" >/etc/init.d/elogind

This will help us narrow the problem.
Comment 8 lekto 2021-01-12 17:59:38 UTC
I put consolekit back in xdm and still same. Btw. at this point do you consider this a bug or do you think I messed something up with system? Because if it's my fault I can just put it in a boot runlevel and live with it.
Comment 9 lekto 2021-01-12 18:00:36 UTC
I forgot: I tried old init script.
Comment 10 Piotr Karbowski (RETIRED) gentoo-dev 2021-01-12 19:12:25 UTC
I was under impression that elogind does not work for you even in boot runlevel. Does running it in boot runlevel solves the problems?
Comment 11 lekto 2021-01-12 19:22:09 UTC
Yes, it's working fine.
Comment 12 Piotr Karbowski (RETIRED) gentoo-dev 2021-01-12 19:42:36 UTC
Well this all sounds like some nasty race conditon. If you're sure you tested new elogind with old init script and it worked fine, you might want to check system logs if you don't have some pam errors after first broken login/start.

In any case, elogind in boot runlevel sounds good to me, this is what I would suggest to everyone.
Comment 13 lekto 2021-01-12 20:05:15 UTC
With elogind in boot both the old and the new init scripts are working.
I think message from second comment should include statement that in some cases elogind must be added to boot runlevel to work properly.
Comment 14 Piotr Karbowski (RETIRED) gentoo-dev 2021-01-13 23:04:56 UTC
First we need to define those some cases. This is not voodoo, things should be deterministic. :)

I am very interested in the pam logs, on first, broken login that leaves you without seat and session, does it print anything interesting there?

I would expect pam_consolekit going bananas with pam_elogind, so unless you rmeoved consolekit from your system and have no pam module for it, it could be that pam_consolekit breaks it, one way or another.

Can you clearly confirm that you have consolekit stripped out of your system?
Comment 15 lekto 2021-01-14 15:34:37 UTC
It looks like I don't have consolekit anymore:
># find / | grep -i consolekit
>/usr/portage/x11-apps/xdm/files/xdm-1.1.12-consolekit.patch
>/var/log/ConsoleKit
>/var/log/ConsoleKit/history
>/var/cache/edb/dep/usr/portage/sys-auth/consolekit-1.2.1
>/var/cache/edb/dep/usr/portage/sys-auth/consolekit-9999
>/var/cache/edb/dep/usr/portage/sys-auth/consolekit-1.2.0
>/var/cache/edb/dep/usr/portage/sys-auth/consolekit-1.1.2
>/var/cache/edb/dep/usr/portage/sys-auth/consolekit-1.1.0-r1
>/var/cache/edb/dep/usr/portage/sys-auth/consolekit-0.4.6

I removed xdm from default runlevel to see in logs exactly what happened, tail of /var/log/messages in attachment. I noticed when I run loginctl before running xdm I get "No sessions." and sound is working on first try, but I still can't restart/shutdown from sddm.
Comment 16 lekto 2021-01-14 15:35:02 UTC
Created attachment 682897 [details]
/var/log/messages
Comment 17 Piotr Karbowski (RETIRED) gentoo-dev 2021-01-14 21:15:02 UTC
Since you reported before that on first login the loginctl says there's no session, I will need logs from that very moment. In the logs you provided it seems that elogind is operational and gets you a seat0.

Would you kindly remove elogind from boot runlevel, reboot, login and then get me the logs?
Comment 18 Piotr Karbowski (RETIRED) gentoo-dev 2021-01-14 21:15:37 UTC
*** Bug 765460 has been marked as a duplicate of this bug. ***
Comment 19 Sven Eden 2021-01-15 07:28:24 UTC
That is an error of myself where I wanted to keep one time too close to the systemd source.

Please see:

https://github.com/elogind/elogind/issues/188 (fixed)

And please upgrade sys-auth/elogind to v246.9.2 in which this issue is fixed.

Sorry for the trouble I caused!

For reference:
https://github.com/elogind/elogind/commit/2acad92e046072b6a05ebcd7424912b62e56c1df
Comment 20 lekto 2021-01-15 14:29:27 UTC
Log from comment 16 is without elogind in boot, this apper in /var/log/messages when I run loginclt:
>Jan 15 15:08:15 blaszak dbus-daemon[3537]: [system] Activating service name='org.freedesktop.login1' requested by ':1.2' (uid=0 pid=4404 comm="loginctl ") (using servicehelper)
>Jan 15 15:08:15 blaszak elogind-daemon[4409]: New seat seat0.
>Jan 15 15:08:15 blaszak elogind-daemon[4409]: Watching system buttons on /dev/input/event1 (Power Button)
>Jan 15 15:08:15 blaszak elogind-daemon[4409]: Watching system buttons on /dev/input/event0 (Power Button)
>Jan 15 15:08:15 blaszak elogind-daemon[4409]: Watching system buttons on /dev/input/event9 (A4TECH USB Device Consumer Control)
>Jan 15 15:08:15 blaszak elogind-daemon[4409]: Watching system buttons on /dev/input/event7 (A4TECH USB Device Keyboard)
>Jan 15 15:08:15 blaszak elogind-daemon[4409]: Watching system buttons on /dev/input/event8 (A4TECH USB Device System Control)
>Jan 15 15:08:15 blaszak elogind-daemon[4409]: Watching system buttons on /dev/input/event2 (SEMICO USB Keyboard)
>Jan 15 15:08:15 blaszak elogind-daemon[4409]: Watching system buttons on /dev/input/event3 (SEMICO USB Keyboard Consumer Control)
>Jan 15 15:08:15 blaszak elogind-daemon[4409]: Watching system buttons on /dev/input/event4 (SEMICO USB Keyboard System Control)
>Jan 15 15:08:15 blaszak elogind-daemon[4409]: Watching system buttons on /dev/input/event5 (SEMICO USB Keyboard)
>Jan 15 15:08:15 blaszak dbus-daemon[3537]: [system] Successfully activated service 'org.freedesktop.login1'

(…)
Okay, after I commented those lines sound is working. I still need to restart xdm to be able to shutdown/restart from sddm, but I'm never doing this, so this is fine for me.
Comment 21 Larry the Git Cow gentoo-dev 2021-01-15 16:53:41 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=99560715339a92c3e571406a16e52b57d317e6a4

commit 99560715339a92c3e571406a16e52b57d317e6a4
Author:     Andreas Sturmlechner <asturm@gentoo.org>
AuthorDate: 2021-01-15 16:49:54 +0000
Commit:     Andreas Sturmlechner <asturm@gentoo.org>
CommitDate: 2021-01-15 16:53:31 +0000

    sys-auth/elogind: 246.9.2 version bump
    
    See also: https://github.com/elogind/elogind/issues/188
    
    Closes: https://bugs.gentoo.org/764557
    Package-Manager: Portage-3.0.13, Repoman-3.0.2
    Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>

 sys-auth/elogind/Manifest               |   1 +
 sys-auth/elogind/elogind-246.9.2.ebuild | 148 ++++++++++++++++++++++++++++++++
 2 files changed, 149 insertions(+)
Comment 22 Andreas Sturmlechner gentoo-dev 2021-01-15 16:54:35 UTC
(In reply to Sven Eden from comment #19)
> And please upgrade sys-auth/elogind to v246.9.2 in which this issue is fixed.
Thanks for the fix!