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 677265 - use systemd for suspend and hibernate when available
use systemd for suspend and hibernate when available
Status: RESOLVED FIXED
Product: gnome-session
Classification: Core
Component: gnome-session
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Session Maintainers
Session Maintainers
Depends on:
Blocks: systemd
 
 
Reported: 2012-06-01 12:20 UTC by Matthias Clasen
Modified: 2012-07-08 03:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
simplify systemd implementation (5.01 KB, patch)
2012-06-01 12:21 UTC, Matthias Clasen
none Details | Review
move suspend api to GsmSystem (19.54 KB, patch)
2012-06-01 12:22 UTC, Matthias Clasen
none Details | Review
add system inhibitors (10.80 KB, patch)
2012-06-01 12:22 UTC, Matthias Clasen
none Details | Review
Add system inhibitors (10.89 KB, patch)
2012-07-08 03:18 UTC, Matthias Clasen
committed Details | Review
Move suspend API to GsmSystem (19.53 KB, patch)
2012-07-08 03:18 UTC, Matthias Clasen
committed Details | Review
Update systemd dependencies (850 bytes, patch)
2012-07-08 03:18 UTC, Matthias Clasen
committed Details | Review
Simplify systemd implementation (5.00 KB, patch)
2012-07-08 03:18 UTC, Matthias Clasen
committed Details | Review

Description Matthias Clasen 2012-06-01 12:20:03 UTC
this will allow us to use system-wide inhibitors for suspend, so you won't accidentally suspend your system while another user is burning a cd.
Comment 1 Matthias Clasen 2012-06-01 12:21:45 UTC
Created attachment 215402 [details] [review]
simplify systemd implementation
Comment 2 Matthias Clasen 2012-06-01 12:22:06 UTC
Created attachment 215403 [details] [review]
move suspend api to GsmSystem
Comment 3 Matthias Clasen 2012-06-01 12:22:26 UTC
Created attachment 215404 [details] [review]
add system inhibitors
Comment 4 Richard Hughes 2012-06-01 12:35:05 UTC
Makes sense to me.
Comment 5 Matthias Clasen 2012-06-08 16:01:57 UTC
Review of attachment 215404 [details] [review]:

::: gnome-session/gsm-systemd.c
@@ +507,3 @@
+        res = g_dbus_proxy_call_with_unix_fd_list_finish (proxy, &fd_list, result, &error);
+
+        if (!res) {

we should actually look at res here. It should have type (h), and the integer is the index into the fd list.
Comment 6 Matthias Clasen 2012-07-08 03:18:12 UTC
The following fixes have been pushed:
3cc2619 Add system inhibitors
2e69a0c Move suspend API to GsmSystem
634ea36 Update systemd dependencies
9ab2645 Simplify systemd implementation
Comment 7 Matthias Clasen 2012-07-08 03:18:15 UTC
Created attachment 218245 [details] [review]
Add system inhibitors

When we get a suspend inhibitor, we pass it on to the GsmSystem
implementation, which may try to inhibit suspending system-wide.
This is only implemented for systemd.
Comment 8 Matthias Clasen 2012-07-08 03:18:18 UTC
Created attachment 218246 [details] [review]
Move suspend API to GsmSystem

This allows us to add a systemd-based suspend/hibernate
implementation.
Comment 9 Matthias Clasen 2012-07-08 03:18:21 UTC
Created attachment 218247 [details] [review]
Update systemd dependencies

We no longer use polkit directly, but the systemd suspend and
inhibit apis require a new version.
Comment 10 Matthias Clasen 2012-07-08 03:18:23 UTC
Created attachment 218248 [details] [review]
Simplify systemd implementation

Don't use polkit ourselves, instead call the CanRestart and
CanPowerOff D-Bus methods.