Bug 431817

Summary: KDE4 + gdm = Logout only (no Shutdown, Restart)
Product: [Fedora] Fedora Reporter: Jags FL <jags_fl>
Component: kdebase-workspaceAssignee: Kevin Kofler <kevin>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: low    
Version: rawhideCC: farrellj, fedora, jmccann, kevin, ltinkl, mefoster, rdieter, rstrode, than
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
URL: http://forums.fedoraforum.org/showthread.php?t=180487#post958504
Whiteboard:
Fixed In Version: 4.0.3-3.fc9 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-03-31 13:08:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Switch user screenshot none

Description Jags FL 2008-02-07 03:11:13 UTC
Description of problem:

In Fedora 9 Alpha - KDE 4, when I click > Leave > Shutdown > the screen turns
blue to black and stays at "Logout" or "Cancel"

Also there's NO shutdown option in GNOME. Under "System" I can ONLY "Log Out" no
option to shut down / restart. 

The only way I can shutdown is > Terminal > poweroff ( in GNOME / KDE 4)



Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Kevin Kofler 2008-02-07 03:17:28 UTC
Hmmm, wait a minute: are you using KDM or GDM? (If you installed from the DVD 
and didn't explicitly set DISPLAYMANAGER="KDE" in /etc/sysconfig/desktop, 
you're using GDM.) If it's GDM, I'll reassign to them. Fedora 9 alpha ships a 
rewritten GDM which is still missing lots of things.

Comment 2 Kevin Kofler 2008-02-07 04:06:13 UTC
*** Bug 431815 has been marked as a duplicate of this bug. ***

Comment 3 Jason Farrell 2008-03-25 22:56:16 UTC
This is also the case in F9-beta.
"Leave > System > Restart|Shutdown" only allows you the option to "Logout". You
can't actually reboot from KDE in one step anymore; have to restart/shutdown
from GDM after logging out.

Comment 4 Kevin Kofler 2008-03-25 23:17:00 UTC
That's undoubtedly due to the new GDM. Jon McCann: anything we can/should do to 
make this work?

Comment 5 Rex Dieter 2008-03-26 00:16:56 UTC
fwiw, works with kdm/kde4

Comment 6 Adrian "Adi1981" P. 2008-03-27 14:42:35 UTC
I'm not sure if it's really gdm fault - when earlier I was using F9 rawhide, i
didn't have gdm at all (was using only kdm), and I didn't have reboot/shutdown
option when leaving KDE also. But i thought that i've something messed up with
my system. Now when i've done clean install of F9b, i still have only logout
option in KDE. In gnome everything works fine. Also second thing when trying to
switch users. When i'll choose "Switch user" from K menu, it throws me to
krunner with "SESSIONS" and "no available sessions" → see attached screenshot.

Comment 7 Adrian "Adi1981" P. 2008-03-27 14:43:32 UTC
Created attachment 299334 [details]
Switch user screenshot

Comment 8 Rex Dieter 2008-03-27 16:26:02 UTC
Please, separate bugs for separate issues (switch users...)

FWIW, shutdown/restart with kde4/kdm worksforme (updated to rawhide as of 03/26).

I'll try gdm here in a sec...

Comment 9 Rex Dieter 2008-03-27 16:41:11 UTC
Confirmed, kde(4) + gdm is limited to logout only (rats, broken, again).

Comment 10 Rex Dieter 2008-03-27 16:47:20 UTC
grepping kdebase-workspace src... it would appear gdm is no longer using any of:
/var/run/gdm_socket
/tmp/.gdm_socket

gdm gurus, how is a DE to communicate w/gdm now?

Comment 11 Adrian "Adi1981" P. 2008-03-28 01:36:34 UTC
Well i wrote about switch user here, because i supposed that problems can be
related. Today i have removed gdm, and probably this solved both problems -
shutdown/reboot and switch user. Strange is, that before F9b i had daily rawhide
without gdm installed (or at least i'm almost sure about it), and situation was
similiar. Anyway removing gdm solves temporary both problems.

Comment 12 Kevin Kofler 2008-03-28 03:37:16 UTC
As far as I can tell, system stop/restart is now supposed to be requested from 
ConsoleKit, not GDM.

See how GDM itself does this:
http://svn.gnome.org/viewvc/gdm/trunk/gui/simple-greeter/gdm-greeter-login-window.c?revision=6076&view=markup
(try_system_stop, try_system_restart).

To the GDM maintainers (and the maintainers of any other piece of system 
infrastructure which affects KDE): it would be nice if I wouldn't have to 
figure out this sort of changes by looking at your source code...

Comment 13 Kevin Kofler 2008-03-28 03:54:32 UTC
Hmmm, is it safe to ask ConsoleKit for a halt or restart from within a session? 
As far as I can tell, it just runs /sbin/shutdown as root (after checking with 
PolicyKit if the user requesting it is allowed to do that), with no attempts to 
close running sessions properly at all.

Here's the interface in any case:
<node name="/org/freedesktop/ConsoleKit/Manager">
  <interface name="org.freedesktop.ConsoleKit.Manager">
    <method name="Restart">
      <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
    </method>
    <method name="Stop">
      <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
    </method>

Comment 14 Matthias Clasen 2008-03-28 04:44:50 UTC
The way this is done on the gnome side is that the panel asks the session
manager to save the session, before asking ck to shut down

Comment 15 Kevin Kofler 2008-03-29 06:04:45 UTC
Reassigning to kdebase-workspace and confirming. I'm going to take a look at 
this, if I start getting something done, I'll set it to ON_DEV.

Comment 16 Kevin Kofler 2008-03-29 06:25:12 UTC
This is how GNOME does it (yes, a Fedora-specific patch):
http://cvs.fedoraproject.org/viewcvs/rpms/gnome-panel/devel/gnome-panel-2.22.0-ck-shutdown.patch?rev=1.1&view=markup

Comment 17 Kevin Kofler 2008-03-29 07:22:47 UTC
As far as I can tell, KDE asks the KSMServer to shutdown, which saves and kills 
the session and only then asks the DM to shutdown. So it's safe to just ask 
ConsoleKit to shutdown instead if no valid DM is found (we don't have to add 
session saving like the GNOME patch does because KDE already does that anyway). 
I'll implement exactly that.

Comment 18 Kevin Kofler 2008-03-29 08:26:57 UTC
Should be fixed in kdebase-workspace-4.0.3-3.fc9. Please test!
http://koji.fedoraproject.org/koji/buildinfo?buildID=44225

For developers, here's the patch I'm using:
http://cvs.fedoraproject.org/viewcvs/rpms/kdebase-workspace/devel/kdebase-workspace-4.0.3-ck-shutdown.patch?rev=1.1&view=markup
This is not perfect (e.g. no PolicyKit integration, i.e. no support for 
authenticating if PolicyKit requires it), but for the most common use case 
(only one user logged in at a time, default ConsoleKit policy), it should work.

The change should not affect KDM users at all because my patch will still 
prefer shutting down the traditional way (through a DM) where possible. It will 
only try using ConsoleKit under the new GDM or with no DM at all (e.g. startx).

Note that this fix is for shutdown and restart only, switch user is still not 
supported and I'm not sure the new GDM supports switching users the KDE way at 
all. (GDM does fast user switching differently, the old version could be coaxed 
to work the KDE way, the new one probably can't.)

Comment 19 Than Ngo 2008-03-31 09:59:46 UTC
This issue is happend in all KDE version. I have taken a look at this patch, 
it should fix the problem.

Comment 20 Kevin Kofler 2008-03-31 10:05:30 UTC
> This issue is happend in all KDE version.

Of course, KDE 3 can't shutdown/restart with GDM 2.22 either, but who wants to 
use KDE 3 with GDM 2.22? F8 only has GDM 2.20, F9 only has KDE 4.

Comment 21 Rex Dieter 2008-03-31 13:07:09 UTC
confirmed, kdebase-workspace-4.0.3-3.fc9 works as advertised.

Comment 22 Kevin Kofler 2008-03-31 13:08:01 UTC
Thanks Rex!