GNOME Bugzilla – Bug 549150
Cannot restart/shutdown/... from a GNOME session
Last modified: 2016-09-13 21:27:32 UTC
Please describe the problem: I cannot restart/shutdown my PC from the Gnome menu. gnome-session[4384]: DEBUG(+): GsmManager: Shutdown called gnome-session[4384]: DEBUG(+): GsmConsolekit: built without PolicyKit-gnome support - cannot restart system gnome-session[4384]: DEBUG(+): GsmConsolekit: built without PolicyKit-gnome support - cannot stop system gnome-session[4384]: DEBUG(+): GsmManager: Logout dialog response: 3 gnome-session[4384]: DEBUG(+): GsmManager: requesting reboot gnome-session[4384]: DEBUG(+): GsmConsolekit: built without PolicyKit-gnome support - cannot restart system Granted, I don't have policykit support enabled, since that is labelled unstable in my distro. But I don't recall ever having policykit, so how did it I restart/shutdown before? Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information:
It seems that when I log out manually, the shutdown/restart is done.
Happens to me as well, running 2.23.90 on Gentoo. I also do not have policykit support built so I will rebuild gnome-session with that and see if it eliminates the problem.
Rebuilding with policykit made no difference, I still can't logout or shutdown from within Gnome.
After several updates including gnome-panel 2.23.90.1 were installed today, this problem went away for me.
For me, gnome-panel-2.23.90.1 solves the logging out, but not the restart/shutdown. Can you confirm that you can now just click "Shutdown" and your system does a shutdown? Policykit support?
It worked the first time I tried it. Now it no longer does, and I have the following in my log: Aug 26 07:21:02 joehome gnome-session[4669]: DEBUG(+): GsmManager: Shutdown called Aug 26 07:21:04 joehome gnome-session[4669]: DEBUG(+): GsmManager: Logout dialog response: 2 Aug 26 07:21:04 joehome gnome-session[4669]: DEBUG(+): GsmManager: requesting shutdown Aug 26 07:21:04 joehome gnome-session[4669]: WARNING: Unable to stop system: Not privileged for action: org.freedesktop.consolekit.system.stop Aug 26 07:21:14 joehome gnome-session[4669]: DEBUG(+): GsmManager: Logout called Aug 26 07:21:14 joehome gnome-session[4669]: WARNING: Unable to determine session: Unable to lookup session information for process '4669' Aug 26 07:21:14 joehome gnome-session[4669]: DEBUG(+): seat id is not set; can't switch sessions All packages that support policykit, including consolekit and gnome-session, are built with policykit. This would seem to indicate the problem is related to consolekit/policykit.
To be clear -- sometimes shutdown/reboot work, sometimes they don't. Aside from messages like those in comment #6 I don't have any details on why. If a developer could suggest a course of action to debug this, I would be glad to help.
without any policykit bits enabled on my system it doesn't work like in comment #0. However, clicking either shutdown or restart is "cached" until I did System->Logout->Logout, then the box either shuts down or restarts according the the last button I clicked in the shutdown dialog. This is kind of annoying and I hope it'll get fixed before the release. If you need more details, just ask.
Like Gilles said, but it also happens when clicking on Reboot/Shutdown and then killing the xserver with ctrl+alt+backspace. In case that helps to trace down the issue...
I confirm the behavior in comment #8, that's what I meant in #1 with "log out manually".
Okay, could you all tell us: the distro you're using (including version), the gnome-session and gnome-panel versions you're using, the GDM version you're using, if ConsoleKit support is there, if PolicyKit support is there, and how do you try to log out (via the menu bar in the panel, eg).
using gentoo (sorry no version to give :p) I currently have the following versions installed: gnome-session: 2.23.91 gnome-panel: 2.23.91 gdm: 2.20.8 consolekit: tested with 0.2.10 & 0.3.0 (support enabled where announced) policykit: not installed, not enabled I try to log out via the "System" menu in the panel.
Gentoo gnome-session 2.23.91 with policykit support gnome-panel 2.23.91 with policykit support gdm 2.20.8 consolekit 0.3.0 with policykit support policykit 0.9
Confirming the bug with gnome-{session,panel,applets,s-d}-2.23.92 and gdm 2.20.8 (on Gentoo again obviously) but without policykit support. How can we track this bug down? Is there some logging to enable? Thanks
ok guys, remi and I spent this morning following the spaghettis up to their respective ends and here is the analysis of the problem. First here is what currently happens if you have policykit support enabled: * gsm ask CK if user can shutdown or restart * user clicks shutdown/restart * gsm tells CK to shutdown/restart * in the eventuality that the user isn't allowed to shutdown/restart right away, gsm ask the password through PK * gsm tells again CK to shutdown thing is, call to PK is actually not possible to reach because in case PK support isn't enabled in gsm, you're not even allowed to see the buttons. To be more precise, only request_{stop,restart}_function ever refers to PK and they are already ifdef'd but the alternative if g_assert_not_reached. That's a bit harsh, why am I forbidden to shutdown at all while it worked just fine in 2.22 and all preceeding versions of gnome ? So what happens on the other side of the street (CK) and what probably motivated this call, well CK (master and 0.3.0) actually don't support shutting down without either policykit or rbac (solaris). This is disappointing since it can (and does if you have pk support) use system well known commands to shutdown or restart. Removing 2 lines and you're done. I'll attach patches to both pieces for reference and will probably a bug at freedesktop for consolekit. Now here is another problem I see with current implementation. I'm no policykit master but it looks like gsm could ask pk the shutdown permissions before deciding if it's necessary to show the buttons or not so that when the user clicks then it asks for a password right away instead of asking CK to perform the action and then asking for the password. Fewer round trips for CK. Hope this is clear, attaching patches in a moment.
Created attachment 119741 [details] [review] gnome-session-HEAD-shutdown.patch this is a blunt patch doing the simplest change to make things work again in a non PK setup. This is probably not so suitable for integration as is, at least I'd prefer fixing the logic as explained at the end of previous comment.
Created attachment 119742 [details] [review] consolekit-0.3.0-shutdown.patch fix for consolekit being to strict in its idea of who has the right to shutdown.
I'm having the same problem with gnome-session 2.24.0. The gnome-session-HEAD-shutdown.patch doesn't help. I'm running gnome 2.24.0 in Zenwalk with policykit 0.9 (but no consolekit)
Tried with gnome-session 2.24.1 but the problem persists. I also have consolekit 0.3.0 installed now and I'm getting this every time I try to reboot or shutdown: gnome-session[1535]: WARNING: Could not connect to ConsoleKit: Could not get owner of name 'org.freedesktop.ConsoleKit': no such name
Disregard my previous comment, it is fixed for me with gnome-session 2.24.1 and consolekit 0.3.0+patch.
I assume this is fixed then.
actually this is not George is speaking of the patched versions, and the patches didn't get any kind of review too.
The patch is a ConsoleKit patch. It has very little hope of getting review in a gnome-session bug...
and what about the gnome session patch ? They work together, that's why they are both posted here. I also opened a bug at freedesktop for the consolekit patch: http://bugs.freedesktop.org/show_bug.cgi?id=17862
Comment #20 seems to indicate that gnome-session 2.24.1 works unpatched ?
Correct, unpatched gnome-session 2.24.1 works fine for me.
(In reply to comment #26) > Correct, unpatched gnome-session 2.24.1 works fine for me. > are you sure ? If you are using gentoo gnome overlay, 2.24.1 is patched. Could you also tell us if you have policykit installed ? Please reread comment #15 which explains how the pieces fit together.
I am using Zenwalk and I'm maintaing the gnome-session package, which is now 2.24.1 unpatched. I also have a patched policykit-0.9 and a patched consolekit-0.3.0. You can find the patches+buildscripts for policykit here: http://download.zenwalk.org/source/extra/ap/policykit/ and for consolekit here: http://download.zenwalk.org/source/extra/ap/consolekit/
ok, then let me repeat the problem here, we want to use basic functionnalities of our machines without being forced into policykit. Thanks.
Installation: - openSUSE 11.1 - gnome-session 2.24.1 - gnome-panel 2.24.1 - kdm (KDE4 was first installed on this computer and, erm, I don't know how to check which version kdm is.) - PolicyKit 0.9 - ConsoleKit 0.2.10 When trying to shutdown or restart from the menu bar (clicking shutdown under System, then Halt or Reboot), I'm back to the login screen (from there, kdm, I can then shutdown or reboot). (on openSUSE's bugzilla : https://bugzilla.novell.com/show_bug.cgi?id=443514 )
Created attachment 133974 [details] [review] gnome-session-2.26.1-shutdown.patch this is the updated patch we are using with gnome-session 2.26
(In reply to comment #31) > Created an attachment (id=133974) [edit] > gnome-session-2.26.1-shutdown.patch > > this is the updated patch we are using with gnome-session 2.26 Thanks for your very fast reply. I'm forwarding it to the openSUSE's bugzilla.
(In reply to Gilles Dartiguelongue from comment #29) > ok, then let me repeat the problem here, we want to use basic > functionnalities of our machines without being forced into policykit. Thanks. So this isn't realistic for a long time now, closing as OBSOLETE