Bug 27147 - Multi-users successive logins, plasmashell no longer runs log on to whatever user after going into sleep
Summary: Multi-users successive logins, plasmashell no longer runs log on to whatever ...
Status: NEW
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: x86_64 Linux
Priority: Normal major
Target Milestone: Mageia 8
Assignee: KDE maintainers
QA Contact:
URL:
Whiteboard:
Keywords: IN_ERRATA8
Depends on:
Blocks: 17523
  Show dependency treegraph
 
Reported: 2020-08-20 11:34 CEST by Aurelien Oudelet
Modified: 2021-02-22 19:12 CET (History)
2 users (show)

See Also:
Source RPM: kglobalaccel-5.76.0-1.mga8.src.rpm
CVE:
Status comment:


Attachments
journalctl -b -1 output when doing tests (69.39 KB, application/x-xz)
2020-08-20 11:34 CEST, Aurelien Oudelet
Details
ksysguard: still running process belonging to no longer connected user (325.68 KB, image/png)
2020-08-24 00:00 CEST, Aurelien Oudelet
Details

Description Aurelien Oudelet 2020-08-20 11:34:01 CEST
Created attachment 11812 [details]
journalctl -b -1 output when doing tests

Today with Cauldron up to date, I do tests following:

1 - Login from sddm (graphical.target) on user1 (uid 1000), desktop 
environment is Plasma 5.
2- Do something within desktop (open app for example).
3- Logout from menus as usual. And go back to sddm.
4- Log on user2 (uid 1001), Plasma session and do something inside like open 
firefox.
5- Log out and go back sddm.
6- Put system to sleep with icon in sddm.
7- Wait several minutes and put system runs with press any key.
8- sddm displays his menu.
9- Log on user1 (uid 1000)
10- See plasmashell not running: black background, mouse OK, autostart apps 
like Konversation open without window decoration, unmovable, KRunner (alt-F2) 
is OK to run apps but they can't be moved.

What I see in journal each time I do plasmashell in Konsole:
plasmashell[8896]: requesting unexisting screen -1
plasmashell[8896]: requesting unexisting screen -1

Ctrl+alt+Backspace 2 times repeated well Zap Xorg server and go well back on 
sddm.

Rebooting system their is a complain:
user2 still logged on seat0
user3 still logged on seat0
Do systemctl reboot -i to ignore inhibitors.

I rebooted there after and after reboot, first session runs fine. Sleep and 
Resume is OK if I don't log out my account.

I can retry this behavior at every try. If system goes to sleep with only sddm 
at tty1, every plasma session launched after don't permit plasmashell from 
running.

Config:
Operating System: Mageia 8
KDE Plasma Version: 5.19.4
KDE Frameworks Version: 5.73.0
Qt Version: 5.15.0
Kernel Version: 5.8.2-desktop-2.mga8
OS Type: 64-bit
Processors: 4 × Intel® Core™ i5-6600K CPU @ 3.50GHz
Memory: 15.6 Gio of RAM
Graphics Processor: GeForce GTX 1660 Ti/PCIe/SSE2

Nvidia nonfree drivers are running version
x11-driver-video-nvidia-current-450.57-3.mga8.nonfree.x86_64

I see this behavior after each system sleep when there is only sddm on tty1:
background of sddm is no longer blurry and each user log on results of no 
plasmashell running when session is opened.

Assigning to sddm maintainers (KDE team) and even basesystem for additional forensics.
Comment 1 Aurelien Oudelet 2020-08-23 23:56:14 CEST
After carefully reading my logs... I see sessions are not properly closed.

$ loginctl list-sessions
SESSION  UID USER     SEAT  TTY
     c2 1000 aurelien seat0    
     c4 1002 enfants  seat0    
     c6 1000 aurelien seat0    

Normally c2 and c4 sessions must be closed and no longer seen while c6 exists.
I am not using fast-userswitching here.

systemd misconfiguration? sddm was c1, c3 and c5 session.
Added attachment from Ksysguard.
Comment 2 Aurelien Oudelet 2020-08-24 00:00:04 CEST
Created attachment 11825 [details]
ksysguard: still running process belonging to no longer connected user

In Ksysguard:

There are running process belonging to no longer connected user.
In this case, they belong to user "enfant" who is no longer connected to what ever TTY.

TTY1 (graphical) is user 1000 (aurelien) and no other TTY has a graphical session.
Comment 3 José Jorge 2020-08-24 08:58:31 CEST
I confirm this bug. After closing a user session, I have to kill the following processes manually :
- /usr/lib/systemd/systemd --user
- gpgagent
- sshagent
- /usr/libexec/geoclue-2.0/demos/agent

CC: (none) => lists.jjorge

Aurelien Oudelet 2020-10-29 16:13:22 CET

Blocks: (none) => 17523

Aurelien Oudelet 2020-12-26 16:53:11 CET

Source RPM: sddm-0.18.1-4.mga8.src.rpm => sddm-0.19.0-3.mga8.src.rpm

Comment 4 Aurelien Oudelet 2021-01-11 11:17:25 CET
I do think the issue is in how Plasma handles a logout. Instead of killing definitely all Plasma applications, some are still here and wait for X11 server...

Also, some don't properly die on exit.
This is in process to be managed by systemd scope in Plasma 5.21 (Optional).

Also, this upstream fixed bug:
https://bugs.kde.org/show_bug.cgi?id=429426

this is still present in our distribution.
Comment 5 Aurelien Oudelet 2021-01-11 11:25:55 CET
I also wonder why X server complains about missing logind integration when running sddm although this not affect GDM and GNOME.

In /var/log/Xorg.0.log

[    19.081] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration

If this is provided, a logout in Plasma results of properly handle all remaining user process.

Target Milestone: --- => Mageia 8
CC: lists.jjorge => (none)
Source RPM: sddm-0.19.0-3.mga8.src.rpm => kglobalaccel-5.76.0-1.mga8.src.rpm

Comment 6 Aurelien Oudelet 2021-01-28 10:02:48 CET
Partially fixed.
kglobalaccel5 will no longer trigger a relaunch of itself will session is logged out. Fix backported by David Geiger. Thank you so much.

If you boot your system, log on to the first time via sddm to Plasma Desktop, your session is seen by systemd/logind as session "c2".

If you logout, or trigger "Ctrl + Alt + Backspace" twice :
Some process remains actives to the session c2 like:

- baloo_file (/etc/xdg/autostart/baloo_file.desktop)
which is owned by baloo-5.76.0-2.mga8.src.rpm

- geoclue (/etc/xdg/autostart/geoclue-demo-agent.desktop)
which is owned by geoclue-2.5.7-1.mga8.src.rpm

These two process are not killed when the Plasma session is logged off.

But, as far as I can see, the new Plasma session no longer make sooo loong time to startup next time.

Not as a side effect, that if you do a Ctrl + Alt + Backspace twice, this will deactivate the Plasma compositor on next logon. Even if you reactivate it under Plasma Systemsettings5 => Hardware => Display and Monitor => Compositor. You don't have full 3D accelerated session. This is the desired upstream behavior. You need to restart your session again...
Comment 7 Morgan Leijström 2021-02-05 20:44:05 CET
Added this bug to errata in a simple way, for now.

CC: (none) => fri
Keywords: (none) => IN_ERRATA8

Comment 8 Morgan Leijström 2021-02-22 18:58:06 CET
So for us who dont care about baloo or geoclue, we can simply remove that two .desktop files from autostart/ ?
Comment 9 Aurelien Oudelet 2021-02-22 19:12:38 CET
(In reply to Morgan Leijström from comment #8)
> So for us who dont care about baloo or geoclue, we can simply remove that
> two .desktop files from autostart/ ?

I think.
But something that normally cleans up the session at logout does not do its job.
I do think this is due to logind integration that is not working for Plasma.
If you see /var/log/Xorg.0.log you can see a complain about -keeptty not present and that logind integration is not enabled.

Note You need to log in before you can comment on or make changes to this bug.