After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 549150 - Cannot restart/shutdown/... from a GNOME session
Cannot restart/shutdown/... from a GNOME session
Status: RESOLVED OBSOLETE
Product: gnome-session
Classification: Core
Component: general
2.23.x
Other All
: Normal major
: ---
Assigned To: Session Maintainers
Session Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-08-23 21:57 UTC by spam
Modified: 2016-09-13 21:27 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
gnome-session-HEAD-shutdown.patch (2.11 KB, patch)
2008-10-01 21:38 UTC, Gilles Dartiguelongue
none Details | Review
consolekit-0.3.0-shutdown.patch (924 bytes, patch)
2008-10-01 21:39 UTC, Gilles Dartiguelongue
none Details | Review
gnome-session-2.26.1-shutdown.patch (4.40 KB, patch)
2009-05-04 22:59 UTC, Gilles Dartiguelongue
none Details | Review

Description spam 2008-08-23 21:57:48 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:
Comment 1 spam 2008-08-23 22:09:38 UTC
It seems that when I log out manually, the shutdown/restart is done.
Comment 2 Jose M. daLuz 2008-08-24 15:28:49 UTC
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.
Comment 3 Jose M. daLuz 2008-08-24 18:01:22 UTC
Rebuilding with policykit made no difference, I still can't logout or shutdown from within Gnome.
Comment 4 Jose M. daLuz 2008-08-25 23:56:36 UTC
After several updates including gnome-panel 2.23.90.1 were installed today, this problem went away for me.
Comment 5 spam 2008-08-26 06:19:16 UTC
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?
Comment 6 Jose M. daLuz 2008-08-26 12:38:37 UTC
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.
Comment 7 Jose M. daLuz 2008-08-27 12:29:40 UTC
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.
Comment 8 Gilles Dartiguelongue 2008-09-07 21:22:51 UTC
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.
Comment 9 Rémi Cardona 2008-09-08 09:04:01 UTC
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...
Comment 10 spam 2008-09-08 11:06:12 UTC
I confirm the behavior in comment #8, that's what I meant in #1 with "log out manually".
Comment 11 Vincent Untz 2008-09-08 11:39:22 UTC
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).
Comment 12 Gilles Dartiguelongue 2008-09-08 14:21:27 UTC
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.
Comment 13 spam 2008-09-09 07:55:52 UTC
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
Comment 14 Rémi Cardona 2008-09-09 21:58:26 UTC
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
Comment 15 Gilles Dartiguelongue 2008-10-01 21:37:07 UTC
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.
Comment 16 Gilles Dartiguelongue 2008-10-01 21:38:59 UTC
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.
Comment 17 Gilles Dartiguelongue 2008-10-01 21:39:59 UTC
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.
Comment 18 George Vlahavas 2008-10-17 21:58:09 UTC
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)
Comment 19 George Vlahavas 2008-10-22 20:57:23 UTC
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
Comment 20 George Vlahavas 2008-10-23 20:11:06 UTC
Disregard my previous comment, it is fixed for me with gnome-session 2.24.1 and consolekit 0.3.0+patch.
Comment 21 Matthias Clasen 2008-11-08 02:56:35 UTC
I assume this is fixed then.
Comment 22 Gilles Dartiguelongue 2008-11-08 10:45:03 UTC
actually this is not George is speaking of the patched versions, and the patches didn't get any kind of review too.
Comment 23 Matthias Clasen 2008-11-08 19:41:34 UTC
The patch is a ConsoleKit patch. It has very little hope of getting review in a gnome-session bug...
Comment 24 Gilles Dartiguelongue 2008-11-08 22:20:39 UTC
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 25 Matthias Clasen 2008-11-09 15:48:33 UTC
Comment #20 seems to indicate that gnome-session 2.24.1 works unpatched ?
Comment 26 George Vlahavas 2008-11-09 21:03:40 UTC
Correct, unpatched gnome-session 2.24.1 works fine for me.
Comment 27 Gilles Dartiguelongue 2008-11-09 22:05:10 UTC
(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.
Comment 28 George Vlahavas 2008-11-09 22:14:38 UTC
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/
Comment 29 Gilles Dartiguelongue 2008-11-09 23:38:55 UTC
ok, then let me repeat the problem here, we want to use basic functionnalities of our machines without being forced into policykit. Thanks.
Comment 30 Philippe Duchenne 2009-05-04 22:54:15 UTC
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 )
Comment 31 Gilles Dartiguelongue 2009-05-04 22:59:06 UTC
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
Comment 32 Philippe Duchenne 2009-05-05 16:15:17 UTC
(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.
Comment 33 Michael Catanzaro 2016-09-13 21:27:32 UTC
(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