blob: de7bb74315be80a6e44ac851cfa627779c6451df (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
From: Michael Biebl <biebl@debian.org>
Date: Sat, 12 Apr 2014 12:38:09 +0200
Subject: Don't setup Sleep Monitor if not booted with systemd
NetworkManager uses systemd for suspend/resume support. It listens for
the PrepareForSleep and Resume D-Bus signal sent by logind/systemd and
deactivates the interfaces on sleep and reactivates them on resume.
With a standalone logind we don't get a Resume signal and
NetworkManager remains in sleep mode where the devices are unmanaged.
As a workaround, skip the Sleep Monitor setup if not booted with
systemd.
Closes: #742933
---
src/nm-sleep-monitor.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/nm-sleep-monitor.c b/src/nm-sleep-monitor.c
index 13ce1be..561e503 100644
--- a/src/nm-sleep-monitor.c
+++ b/src/nm-sleep-monitor.c
@@ -25,6 +25,7 @@
#include <string.h>
#include <sys/stat.h>
#include <gio/gunixfdlist.h>
+#include <systemd/sd-daemon.h>
#include "nm-core-internal.h"
#include "NetworkManagerUtils.h"
@@ -340,6 +341,10 @@ on_proxy_acquired (GObject *object,
static void
nm_sleep_monitor_init (NMSleepMonitor *self)
{
+ if (!sd_booted()) {
+ nm_log_warn (LOGD_SUSPEND, "Skipping Sleep Monitor setup, system not booted with systemd");
+ return;
+ }
self->inhibit_fd = -1;
self->cancellable = g_cancellable_new ();
g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
|