1 --- NetworkManager-1.8.0/configure.ac.orig 2017-05-27 22:30:22.001467624 +0200
2 +++ NetworkManager-1.8.0/configure.ac 2017-05-27 22:57:15.061449204 +0200
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 --- NetworkManager-1.28.0/src/core/nm-session-monitor.c.orig 2020-11-17 22:24:23.000000000 +0100
13 +++ NetworkManager-1.28.0/src/core/nm-session-monitor.c 2020-12-07 17:27:16.046393625 +0100
17 #if SESSION_TRACKING_SYSTEMD
18 + #include <systemd/sd-daemon.h>
19 #include <systemd/sd-login.h>
20 #define LOGIND_NAME "systemd-logind"
22 @@ -52,13 +53,11 @@ struct _NMSessionMonitor {
26 -#if SESSION_TRACKING_CONSOLEKIT
28 GFileMonitor *monitor;
35 struct _NMSessionMonitorClass {
36 @@ -136,7 +135,6 @@ st_sd_finalize(NMSessionMonitor *monitor
38 /*****************************************************************************/
40 -#if SESSION_TRACKING_CONSOLEKIT
44 @@ -269,7 +267,6 @@ ck_finalize(NMSessionMonitor *monitor)
45 nm_clear_pointer(&monitor->ck.cache, g_hash_table_unref);
46 g_clear_object(&monitor->ck.monitor);
48 -#endif /* SESSION_TRACKING_CONSOLEKIT */
50 /*****************************************************************************/
52 @@ -295,14 +292,15 @@ nm_session_monitor_session_exists(NMSess
53 g_return_val_if_fail(NM_IS_SESSION_MONITOR(self), FALSE);
55 #if SESSION_TRACKING_XLOGIND
56 + if (sd_booted() > 0) {
57 if (st_sd_session_exists(self, uid, active))
62 -#if SESSION_TRACKING_CONSOLEKIT
64 if (ck_session_exists(self, uid, active))
71 @@ -313,26 +311,28 @@ static void
72 nm_session_monitor_init(NMSessionMonitor *monitor)
74 #if SESSION_TRACKING_XLOGIND
75 + if (sd_booted() > 0) {
77 _LOGD("using " LOGIND_NAME " session tracking");
81 -#if SESSION_TRACKING_CONSOLEKIT
84 _LOGD("using ConsoleKit session tracking");
90 finalize(GObject *object)
92 #if SESSION_TRACKING_XLOGIND
93 + if (sd_booted() > 0)
94 st_sd_finalize(NM_SESSION_MONITOR(object));
98 -#if SESSION_TRACKING_CONSOLEKIT
99 ck_finalize(NM_SESSION_MONITOR(object));
102 G_OBJECT_CLASS(nm_session_monitor_parent_class)->finalize(object);
104 --- NetworkManager-1.28.0/src/core/nm-sleep-monitor.c.orig 2020-11-17 22:24:23.000000000 +0100
105 +++ NetworkManager-1.28.0/src/core/nm-sleep-monitor.c 2020-12-07 21:18:39.301181579 +0100
107 #include <sys/stat.h>
108 #include <gio/gunixfdlist.h>
110 +#ifdef SUSPEND_RESUME_SYSTEMD
111 +# include <systemd/sd-daemon.h>
114 #include "libnm-core-intern/nm-core-internal.h"
115 #include "NetworkManagerUtils.h"
119 #elif defined(SUSPEND_RESUME_SYSTEMD) || defined(SUSPEND_RESUME_ELOGIND)
121 - #define SUSPEND_DBUS_NAME "org.freedesktop.login1"
122 - #define SUSPEND_DBUS_PATH "/org/freedesktop/login1"
123 - #define SUSPEND_DBUS_INTERFACE "org.freedesktop.login1.Manager"
124 + #define SD_SUSPEND_DBUS_NAME "org.freedesktop.login1"
125 + #define SD_SUSPEND_DBUS_PATH "/org/freedesktop/login1"
126 + #define SD_SUSPEND_DBUS_INTERFACE "org.freedesktop.login1.Manager"
128 #if defined(SUSPEND_RESUME_SYSTEMD)
129 #define _NMLOG_PREFIX_NAME "sleep-monitor-sd"
132 #elif defined(SUSPEND_RESUME_CONSOLEKIT)
134 + #define USE_UPOWER 0
135 + #define _NMLOG_PREFIX_NAME "sleep-monitor-ck"
139 +#error define one of SUSPEND_RESUME_SYSTEMD, SUSPEND_RESUME_ELOGIND, SUSPEND_RESUME_CONSOLEKIT, or SUSPEND_RESUME_UPOWER
143 +#if defined (SUSPEND_RESUME_SYSTEMD) || defined(SUSPEND_RESUME_CONSOLEKIT)
145 /* ConsoleKit2 has added the same suspend/resume DBUS API that Systemd
146 * uses. http://consolekit2.github.io/ConsoleKit2/#Manager.Inhibit
149 #define SUSPEND_DBUS_NAME "org.freedesktop.ConsoleKit"
150 #define SUSPEND_DBUS_PATH "/org/freedesktop/ConsoleKit/Manager"
151 #define SUSPEND_DBUS_INTERFACE "org.freedesktop.ConsoleKit.Manager"
152 - #define USE_UPOWER 0
153 - #define _NMLOG_PREFIX_NAME "sleep-monitor-ck"
157 - #error define one of SUSPEND_RESUME_SYSTEMD, SUSPEND_RESUME_ELOGIND, SUSPEND_RESUME_CONSOLEKIT, or SUSPEND_RESUME_UPOWER
161 @@ -329,6 +338,20 @@ nm_sleep_monitor_init(NMSleepMonitor *se
163 self->inhibit_fd = -1;
164 self->cancellable = g_cancellable_new();
165 +#ifdef SUSPEND_RESUME_SYSTEMD
166 + if (sd_booted() > 0)
167 + g_dbus_proxy_new_for_bus(G_BUS_TYPE_SYSTEM,
168 + G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START
169 + | G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
171 + SD_SUSPEND_DBUS_NAME,
172 + SD_SUSPEND_DBUS_PATH,
173 + SD_SUSPEND_DBUS_INTERFACE,
175 + (GAsyncReadyCallback) on_proxy_acquired,
179 g_dbus_proxy_new_for_bus(G_BUS_TYPE_SYSTEM,
180 G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START
181 | G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,