Bug 495904 - gnome-session does not send SessionOver, which can cause suspend during shutdown
gnome-session does not send SessionOver, which can cause suspend during shutdown
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: gnome-power-manager (Show other bugs)
rawhide
All Linux
low Severity medium
: ---
: ---
Assigned To: Richard Hughes
Fedora Extras Quality Assurance
:
Depends On:
Blocks: F11Blocker/F11FinalBlocker
  Show dependency treegraph
 
Reported: 2009-04-15 10:18 EDT by Matthias Clasen
Modified: 2009-04-24 10:53 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-04-24 10:53:20 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Matthias Clasen 2009-04-15 10:18:08 EDT
Lately, when I shutdown (using the panel shutdown dialog) and then close the lid,
what happens is that my machine suspends instead of shutting down, and when I later resume, it proceeds to shut down. Highly annoying.

I think the problem is that gpm is not aware that a shutdown is already in progress and it should ignore the lid close.
Comment 1 Richard Hughes 2009-04-15 11:34:36 EDT
gnome-session doesn't send the SessionOver signal at all. It's never emitted in gsm-manager.c at all. If gnome-session emitted that, it would be a trivial patch to gnome-power-manager to exit when this signal is emitted. Reassigning, and then when g-s is fixed we can trivially patch g-p-m.
Comment 2 Matthias Clasen 2009-04-15 11:39:34 EDT
Upstream bug: http://bugzilla.gnome.org/show_bug.cgi?id=579064
Comment 3 Matthias Clasen 2009-04-20 02:10:30 EDT
Actually, the org.gnome.SessionManager.ClientPrivate.EndSession signal is probably the right thing to use. 

Of course, both of these require gpm to actually register with the session. Currently, it has:

        /* optionally register with the session */
        session = gpm_session_new ();
        if (FALSE) {
                egg_warning ("register with the session requires logout handling");
                gpm_session_register_client (session, "gnome-power-manager", getenv ("DESKTOP_AUTOSTART_ID"));
        }
Comment 4 Richard Hughes 2009-04-20 11:01:48 EDT
(In reply to comment #3)
> Actually, the org.gnome.SessionManager.ClientPrivate.EndSession signal is
> probably the right thing to use. 

This works:

commit 8c56ff7be6ed6c9fc12a94137266329db31a8919
Author: Richard Hughes <richard@hughsie.com>
Date:   Mon Apr 20 16:00:22 2009 +0100

    Connect to gnome-session and exit on logout
    
    Register with the session and handle EndSession to fix RH#495904
Comment 5 Matthias Clasen 2009-04-20 21:25:21 EDT
I tested git master briefly, and it works fine, indeed. shutdown-and-close-lid now does shutdown, not suspend in the middle of a half-finished shutdown.

I guess we should also make sure that logout-and-close-lid leads to a suspend when the login session becomes active.
Comment 6 Richard Hughes 2009-04-22 09:43:31 EDT
(In reply to comment #5)
> I guess we should also make sure that logout-and-close-lid leads to a suspend
> when the login session becomes active.  

I think this is a different bug, with a different solution.

Can you please try the packages here: http://koji.fedoraproject.org/koji/buildinfo?buildID=98858 and then we can look at getting the bump into f11-final if there are no problems. Thanks.
Comment 7 Matthias Clasen 2009-04-22 10:45:21 EDT
Works fine for me.
Comment 8 Richard Hughes 2009-04-24 10:53:20 EDT
Tagged for f11-final.

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