From 44189f8129edff56668cad6846579adc0e64f8f3 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 11 Jul 2012 15:06:04 +0100 Subject: Use systemd for suspend and hibernate When running under systemd, call into systemd for suspend and hibernate instead of pm-utils. To capture resume events, install a small script that gets executed by systemd after resume and sends a dbus signal back to upower. To make this work, the upower backends gain a new signal, ::resuming, that they can optionally emit to signal that a resume happened. Backends opt in to this by returning TRUE from up_backend_emits_resuming(). In this case, upower doesn't assume the sleep command to block until resume, but instead waits for the ::resuming signal from the backend. The only backend that uses this mechanism is the linux backend when built with systemd support. Signed-off-by: Richard Hughes --- src/openbsd/up-backend.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/openbsd/up-backend.c') diff --git a/src/openbsd/up-backend.c b/src/openbsd/up-backend.c index 9d724ba..b25fb44 100644 --- a/src/openbsd/up-backend.c +++ b/src/openbsd/up-backend.c @@ -205,6 +205,12 @@ up_backend_get_hibernate_command (UpBackend *backend) return NULL; } +gboolean +up_backend_emits_resuming (UpBackend *backend) +{ + return FALSE; +} + /** * up_backend_kernel_can_suspend: **/ -- cgit v1.2.3