Bug 4605 - Shutdown and reboot buttons in KDE 4.8.0 result in a log out, back to KDM (with systemd)
Summary: Shutdown and reboot buttons in KDE 4.8.0 result in a log out, back to KDM (wi...
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Colin Guthrie
QA Contact:
URL: http://bugs.archlinux.org/task/28386
Whiteboard:
Keywords:
: 4614 4714 4717 4726 4782 4789 (view as bug list)
Depends on:
Blocks: 2120
  Show dependency treegraph
 
Reported: 2012-02-20 15:40 CET by Rémi Verschelde
Modified: 2012-04-02 00:48 CEST (History)
16 users (show)

See Also:
Source RPM: systemd
CVE:
Status comment:


Attachments

Description Rémi Verschelde 2012-02-20 15:40:22 CET
Description of problem:

Whenever I try to shutdown or to reboot my computer using KDE SC 4.8.0 in Cauldron, it results in a log out and I end up with KDM asking me to log in.
Only then can I shutdown or reboot using the buttons in KDM.

Version-Release number of selected component (if applicable):
KDE SC 4.8.0 (cauldron)

This was confirmed on IRC by magnus_de.

How reproducible:

The following actions end up in KDM:
- KDE Menu > Quit > Shutdown
- KDE Menu > Quit > Reboot
- Ctrl-Alt-Del > Shutdown
- Ctrl-Alt-Del > Reboot
- Shutdown button in the default panel
- Reboot button in the default panel (not tested)
Magnus Rasche 2012-02-20 15:42:16 CET

CC: (none) => magnus.mud
Hardware: i586 => All

Comment 1 Magnus Rasche 2012-02-20 17:15:23 CET
same prob with reboot from kde-menue
Comment 2 Rémi Verschelde 2012-02-20 17:45:39 CET
I confirm this issue still applies for Beta1 (I had only tested it on my Cauldron workstation, regularly updated since the release of Mageia 1).
Comment 3 Manuel Hiebel 2012-02-21 22:13:36 CET
*** Bug 4614 has been marked as a duplicate of this bug. ***

CC: (none) => filip.saraiva

Comment 4 Filipe Saraiva 2012-02-21 22:26:20 CET
I have this problem too.
Comment 5 Florin Pulbere 2012-02-22 08:36:45 CET
Bug present after fresh install with beta1 64bit.

CC: (none) => kernelgremlin

Comment 6 Luc Menut 2012-02-22 23:18:48 CET
This bug happens only with systemd. No problem with sysvinit.

c.f.
https://bugs.archlinux.org/task/28386
https://bugs.kde.org/show_bug.cgi?id=293978

URL: (none) => http://bugs.archlinux.org/task/28386
CC: (none) => lmenut, mageia
See Also: (none) => http://bugs.kde.org/show_bug.cgi?id=293978
Blocks: (none) => 2120
Summary: Shutdown and reboot buttons in KDE 4.8.0 result in a log out, back to KDM => Shutdown and reboot buttons in KDE 4.8.0 result in a log out, back to KDM (with systemd)
Source RPM: kdebase-workspace-4.8.0-1.mga2 => kdebase-workspace-4.8.0-1.mga2, systemd

diego w 2012-02-23 20:30:43 CET

CC: (none) => smiling.diego

Comment 7 Morgan Leijström 2012-02-24 00:13:38 CET
Me too. IBM Thinkpad T40. cauldron current.

Interestingly: performing the same in LXDE it briefly trows up a dialog to enter root password it say is needed for this.  I have not managed to be quick enough to type it, but managed to press some info button and read something about ...dbus...session... i think.

May be related: On this system Hibernate and suspend are also broken, and it have problem shutting down https://bugs.mageia.org/show_bug.cgi?id=4475

CC: (none) => fri

Comment 8 Morgan Leijström 2012-02-24 01:31:50 CET
The archlinux bug in #6 above is pretty active and have a couple workarounds.

I tried session managers GDM, and XDM: both there is not this problem.
NOTE: reboot needed for it to work properly.

- it also made my suspend work :)
Comment 9 diego w 2012-02-24 02:09:09 CET
on RazorQt it works as expected, on the same system KDE logs out
Comment 10 Rémi Verschelde 2012-02-24 09:39:35 CET
I also experience bug #4475 as Morgan does.
Comment 11 diego w 2012-02-24 17:16:06 CET
something has changed...

on my setup (with auto login) it still logs out to KDM, but... if I'm logging back in to KDE4 then the shotoff works.

now rebooting again to verify something about 4559
Comment 12 Rémi Verschelde 2012-02-26 13:52:34 CET
I did not experience this bug today, with an up-to-date Cauldron system using systemd. Shutdown was straightforward and didn't bring me back to KDM.
I'll check a second time to be sure.
Comment 13 diego w 2012-02-26 20:06:56 CET
@Rémi, are you using autologin?

I'll update again and retest, there are quite a few 4.8.0-2 RPMs in the queue...
Comment 14 diego w 2012-02-26 21:17:02 CET
still same:

shuting down when logged in manually, just logging out when auto logged in.
Comment 15 Rémi Verschelde 2012-02-26 22:55:39 CET
Unfortunately, the bug is still valid. I did another test and I was sent to KDM.
I use autologin.
Comment 16 Manuel Hiebel 2012-02-27 12:32:32 CET
*** Bug 4714 has been marked as a duplicate of this bug. ***

CC: (none) => jarillon

Comment 17 Manuel Hiebel 2012-02-27 12:33:08 CET
*** Bug 4717 has been marked as a duplicate of this bug. ***

CC: (none) => laidlaws

Comment 18 Manuel Hiebel 2012-02-28 11:49:48 CET
*** Bug 4726 has been marked as a duplicate of this bug. ***

CC: (none) => ottosa

Juan Luis Baptiste 2012-02-28 15:08:56 CET

CC: (none) => juan.baptiste

Comment 19 dennis drown 2012-03-03 11:14:14 CET
i too have this problem M2B1 with all current updates

i dont know if this will help you track down the problem 
but my work around for this is to:

CTRL-ESC
then i kill systemd-logind

after that when i shutdown i do not go back to the login screen

CC: (none) => dadrown1

Comment 20 Doug Laidlaw 2012-03-03 14:53:00 CET
I simply pull down the Shutdown menu in KDM.  It is quicker.
Comment 21 Sander Lepik 2012-03-03 16:00:50 CET
*** Bug 4782 has been marked as a duplicate of this bug. ***

CC: (none) => AndrewL733

Comment 22 dennis drown 2012-03-03 20:06:51 CET
(In reply to comment #20)
> I simply pull down the Shutdown menu in KDM.  It is quicker.

i dont get that far ,as soon as i boot up i kill systemd-logind, then do updates,some testing,then

when i shutdown it shuts down and does not go to kdm login
Comment 23 Manuel Hiebel 2012-03-04 08:34:18 CET
*** Bug 4789 has been marked as a duplicate of this bug. ***

CC: (none) => mriganka13484+floss

Comment 24 Doug Laidlaw 2012-03-07 08:14:48 CET
I have tested this in xfce, which uses GDM.  There is no problem there; it is confined to KDM.
Comment 25 Doug Laidlaw 2012-03-07 08:33:30 CET
I am just downloading another 330 packages of KDE.  They seem to do this every few days, with a hope and a prayer that this time it will work.  It never does.
Comment 26 Colin Guthrie 2012-03-07 09:57:24 CET
(In reply to comment #25)
> I am just downloading another 330 packages of KDE.  They seem to do this every
> few days, with a hope and a prayer that this time it will work.  It never does.

Unless someone actually works on the problem, then it's unlikely to make a difference. Also, such comments on a bug report are not overly useful. This is just one problem among many. Try not to get too upset about it - engineering resources are sadly not infinite!

For reference, as mentioned on the upstream or arch bug report linked above, it's a combinatorial thing. KDM+KDE is the problem. If you use GDM+KDE it's fine, if you use LXDM+KDE it's fine if you use KDM+GNOME it's fine... the broken combo is KDM+KDE.
Comment 27 Luc Menut 2012-03-10 12:19:15 CET
(In reply to comment #26)
[...] the
> broken combo is KDM+KDE.

more exactly, systemd+KDM+KDE :-)

and the "culprit" is ... 'logind: if we have to stop a session, kill at least its leader'
http://cgit.freedesktop.org/systemd/systemd/commit/?id=9b221b63e5cc62439b32bb487775856a78c6015a

since this commit, systemd-logind blindly kills the leader process.

if I delete the 3 lines that kill leader process, shutdown and reboot works fine.
@@ -626,11 +626,6 @@
        * session... */
 
        r = manager_get_session_by_pid(s->manager, s->leader, &t);
-       if (r > 0 && t == s) {
-           kill(s->leader, SIGTERM); /* for normal processes */
-           kill(s->leader, SIGHUP);  /* for shells */
-           kill(s->leader, SIGCONT); /* in case they are stopped */
-       }
   }
 
   r = cg_is_empty_recursive(SYSTEMD_CGROUP_CONTROLLER, s->cgroup_path, true);

I think it's really not safe to kill processes like this is done by systemd-logind, the login manager will exit itself.

Assignee: balcaen.john => mageia
Source RPM: kdebase-workspace-4.8.0-1.mga2, systemd => systemd

Comment 28 Colin Guthrie 2012-03-10 16:33:22 CET
Sadly the diff you showed there cuts off the comment.

                        /* We still send a HUP to the leader process,
                         * even if we are not supposed to kill the
                         * whole cgroup. But let's first check the
                         * leader still exists and belongs to our
                         * session... */

So why is KDM belonging to the user session? It certainly shoudn't. And even in this case why is it different from a KDM->GNOME vs. a KDM->KDE sessions. Smells like KDM is doing strange things when logging into a KDE sessions - perhaps to try and get a smooth transition and thus the KDM process itself is somehow escaping it's cgroup... who knows. Needs investigation.

I suspect strongly that KDM is doing silly things here and while it might have worked, it's likely very bad practice and now causes breakage.
Comment 29 Sander Lepik 2012-03-10 17:44:37 CET
IMHO it's now working again on 4.8.1. But not 100% sure, needs more testers to confirm.

CC: (none) => sander.lepik

Comment 30 Magnus Rasche 2012-03-10 21:33:09 CET
The bug is still there, beta1 just updated.
What can I do?
Comment 31 Doug Laidlaw 2012-03-11 12:11:16 CET
If I read Colin's post correctly, it is really up to KDE to fix it.  I have just booted out of Cauldron with all updates, and it was present then.  It isn't just Mageia with the problem.  archlinux has reported it as well.  I could say: "Didn't I say so?" but as Colin says, that won't progress the bug.
Ben Bullard 2012-03-12 23:51:19 CET

CC: (none) => benbullard79

Comment 32 Colin Guthrie 2012-03-13 22:07:44 CET
Should be fixed in latest kdebase4-workspace thanks to patch from Rex Dieter @ Fedora.

Status: NEW => RESOLVED
Resolution: (none) => FIXED

Comment 33 diego w 2012-03-14 22:36:53 CET
confirmed

thanks
Comment 34 Mriganka Talukdar 2012-03-15 06:20:22 CET
I can confirm too that this has been resolved. Thanks.
Comment 35 Luc Menut 2012-03-29 00:14:01 CEST
Hi Colin,

This recent commit in systemd "logind: close FIFO before ending sessions cleanly",
http://cgit.freedesktop.org/systemd/systemd/commit/?id=75c8e3cffd7da8eede614cf61384957af2c82a29
fixes this bug with KDE/KDM.

I tested our current systemd patched with the logind FIFO patch + our kdebase4-workspace without the fedora patch, and shutdown and reboot work fine.

As the problem is now fixed in systemd, the fedora's patch will probably never reviewed and pushed upstream in KDE. So, if it's possible, I would prefer that we use the systemd official patch and drop the fedora workaround.
WDYT?

regards,
Luc
Comment 36 Colin Guthrie 2012-04-02 00:48:05 CEST
@Luc, yup confirmed here also. systemd updated and kdebase4-workspace also updated and submitted for build. Thanks for letting me know - I'll comment on upstream bug.

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