1 --- NetworkManager-1.2.2/configure.ac.systemd 2016-05-17 22:29:49.567521947 +0200
2 +++ NetworkManager-1.2.2/configure.ac 2016-05-17 23:14:31.594510933 +0200
3 @@ -435,7 +435,7 @@ AS_IF([test -z "$use_consolekit"], [use_
6 if test "$use_systemd_logind" = "yes" -o "$use_systemd_logind" = "auto"; then
7 - PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd], [have_systemd_logind=yes], [PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd-login], [have_systemd_logind=yes], [have_systemd_logind=no])])
8 + PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd], [have_systemd_logind=yes], [PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd-daemon libsystemd-login], [have_systemd_logind=yes], [have_systemd_logind=no])])
10 have_systemd_logind=no
12 @@ -447,12 +447,13 @@ if test "$have_systemd_logind" = "yes";
13 session_tracking="$session_tracking, systemd-logind"
15 if test "$use_consolekit" = "yes"; then
16 - AC_DEFINE([SESSION_TRACKING_CONSOLEKIT], 1, [Define to 1 if ConsoleKit is available])
17 - AC_DEFINE([CKDB_PATH], "/var/run/ConsoleKit/database", [Path to ConsoleKit database])
18 + AC_DEFINE([SESSION_TRACKING_CONSOLEKIT], 1, [Define to 1 if ConsoleKit is available])
19 session_tracking="$session_tracking, consolekit"
21 session_tracking="$(printf '%s' "${session_tracking}" | sed 's/^, //')"
23 +AC_DEFINE([CKDB_PATH], "/var/run/ConsoleKit/database", [Path to ConsoleKit database])
25 AC_ARG_WITH(suspend-resume, AS_HELP_STRING([--with-suspend-resume=upower|systemd|consolekit], [Build NetworkManager with specific suspend/resume support]))
26 if test "z$with_suspend_resume" = "z"; then
27 PKG_CHECK_EXISTS([libsystemd >= 209], [have_systemd_inhibit=yes],
28 --- NetworkManager-1.6.0/src/nm-session-monitor.c.orig 2017-01-16 15:08:37.000000000 +0100
29 +++ NetworkManager-1.6.0/src/nm-session-monitor.c 2017-01-26 20:00:57.570052887 +0100
33 #ifdef SESSION_TRACKING_SYSTEMD
34 +#include <systemd/sd-daemon.h>
35 #include <systemd/sd-login.h>
38 @@ -53,13 +54,11 @@ struct _NMSessionMonitor {
42 -#ifdef SESSION_TRACKING_CONSOLEKIT
44 GFileMonitor *monitor;
51 struct _NMSessionMonitorClass {
52 @@ -132,7 +131,6 @@ st_sd_finalize (NMSessionMonitor *monito
54 /*****************************************************************************/
56 -#ifdef SESSION_TRACKING_CONSOLEKIT
60 @@ -266,7 +264,6 @@ ck_finalize (NMSessionMonitor *monitor)
61 g_clear_pointer (&monitor->ck.cache, g_hash_table_unref);
62 g_clear_object (&monitor->ck.monitor);
64 -#endif /* SESSION_TRACKING_CONSOLEKIT */
66 /*****************************************************************************/
68 @@ -338,13 +335,16 @@ nm_session_monitor_session_exists (NMSes
69 g_return_val_if_fail (NM_IS_SESSION_MONITOR (self), FALSE);
71 #ifdef SESSION_TRACKING_SYSTEMD
72 - if (st_sd_session_exists (self, uid, active))
74 + if (sd_booted () > 0) {
75 + if (st_sd_session_exists (self, uid, active))
80 -#ifdef SESSION_TRACKING_CONSOLEKIT
81 if (ck_session_exists (self, uid, active))
84 +#ifdef SESSION_TRACKING_SYSTEMD
89 @@ -356,26 +356,27 @@ static void
90 nm_session_monitor_init (NMSessionMonitor *monitor)
92 #ifdef SESSION_TRACKING_SYSTEMD
93 + if (sd_booted () > 0) {
95 _LOGD ("using systemd-logind session tracking");
99 -#ifdef SESSION_TRACKING_CONSOLEKIT
102 _LOGD ("using ConsoleKit session tracking");
108 finalize (GObject *object)
110 #ifdef SESSION_TRACKING_SYSTEMD
111 + if (sd_booted () > 0)
112 st_sd_finalize (NM_SESSION_MONITOR (object));
116 -#ifdef SESSION_TRACKING_CONSOLEKIT
117 ck_finalize (NM_SESSION_MONITOR (object));
120 G_OBJECT_CLASS (nm_session_monitor_parent_class)->finalize (object);
122 --- NetworkManager-1.4.0/src/nm-sleep-monitor.c.orig 2016-08-24 15:09:03.000000000 +0200
123 +++ NetworkManager-1.4.0/src/nm-sleep-monitor.c 2016-09-27 16:43:07.397044526 +0200
125 #include <sys/stat.h>
126 #include <gio/gunixfdlist.h>
128 +#ifdef SUSPEND_RESUME_SYSTEMD
129 +# include <systemd/sd-daemon.h>
132 #include "nm-core-internal.h"
133 #include "NetworkManagerUtils.h"
137 #elif defined (SUSPEND_RESUME_SYSTEMD)
139 -#define SUSPEND_DBUS_NAME "org.freedesktop.login1"
140 -#define SUSPEND_DBUS_PATH "/org/freedesktop/login1"
141 -#define SUSPEND_DBUS_INTERFACE "org.freedesktop.login1.Manager"
142 +#define SD_SUSPEND_DBUS_NAME "org.freedesktop.login1"
143 +#define SD_SUSPEND_DBUS_PATH "/org/freedesktop/login1"
144 +#define SD_SUSPEND_DBUS_INTERFACE "org.freedesktop.login1.Manager"
146 #define _NMLOG_PREFIX_NAME "sleep-monitor-sd"
148 #elif defined(SUSPEND_RESUME_CONSOLEKIT)
150 +#define USE_UPOWER 0
151 +#define _NMLOG_PREFIX_NAME "sleep-monitor-ck"
155 +#error define one of SUSPEND_RESUME_SYSTEMD, SUSPEND_RESUME_CONSOLEKIT, or SUSPEND_RESUME_UPOWER
159 +#if defined (SUSPEND_RESUME_SYSTEMD) || defined(SUSPEND_RESUME_CONSOLEKIT)
161 /* ConsoleKit2 has added the same suspend/resume DBUS API that Systemd
162 * uses. http://consolekit2.github.io/ConsoleKit2/#Manager.Inhibit
164 #define SUSPEND_DBUS_NAME "org.freedesktop.ConsoleKit"
165 #define SUSPEND_DBUS_PATH "/org/freedesktop/ConsoleKit/Manager"
166 #define SUSPEND_DBUS_INTERFACE "org.freedesktop.ConsoleKit.Manager"
167 -#define USE_UPOWER 0
168 -#define _NMLOG_PREFIX_NAME "sleep-monitor-ck"
172 -#error define one of SUSPEND_RESUME_SYSTEMD, SUSPEND_RESUME_CONSOLEKIT, or SUSPEND_RESUME_UPOWER
178 self->inhibit_fd = -1;
179 self->cancellable = g_cancellable_new ();
180 +#ifdef SUSPEND_RESUME_SYSTEMD
181 + if (sd_booted () > 0)
182 + g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
183 + G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START |
184 + G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
186 + SD_SUSPEND_DBUS_NAME, SD_SUSPEND_DBUS_PATH, SD_SUSPEND_DBUS_INTERFACE,
188 + (GAsyncReadyCallback) on_proxy_acquired, self);
191 g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
192 G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START |
193 G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,