Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Maintenance:4303
NetworkManager.openSUSE_13.2_Update
NetworkManager-logind-auto-launch-disable.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File NetworkManager-logind-auto-launch-disable.patch of Package NetworkManager.openSUSE_13.2_Update
From 9458d8151ceb67287deec9f0405c86642777853e Mon Sep 17 00:00:00 2001 From: Dan Williams <dcbw@redhat.com> Date: Mon, 15 Dec 2014 14:15:55 -0600 Subject: core: don't auto-launch logind (bgo #741572) logind might need the network for login information, and apparently it fails hard if the network isn't up, and apparently it doesn't recover when the network does come up. Since NM doesn't actually care about suspend/resume until logind is running anyway, don't auto-launch it. Just wait until it shows up. While we're at it, make proxy creation async. https://bugzilla.gnome.org/show_bug.cgi?id=741572 (cherry picked from commit 5a051ad71671b5808f7b57d5d2cdaaa7b4a66d67) diff --git a/src/nm-sleep-monitor-systemd.c b/src/nm-sleep-monitor-systemd.c index 55134c4..6398b8f 100644 --- a/src/nm-sleep-monitor-systemd.c +++ b/src/nm-sleep-monitor-systemd.c @@ -149,24 +149,59 @@ signal_cb (GDBusProxy *proxy, } static void -sleep_setup (NMSleepMonitor *self) +name_owner_cb (GObject *object, + GParamSpec *pspec, + gpointer user_data) { - GDBusConnection *bus; + GDBusProxy *proxy = G_DBUS_PROXY (object); + NMSleepMonitor *self = NM_SLEEP_MONITOR (user_data); + char *owner; - bus = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, NULL); - self->sd_proxy = g_dbus_proxy_new_sync (bus, 0, NULL, - SD_NAME, SD_PATH, SD_INTERFACE, - NULL, NULL); - g_object_unref (bus); + g_assert (proxy == self->sd_proxy); + + owner = g_dbus_proxy_get_name_owner (proxy); + if (owner) + take_inhibitor (self); + else + drop_inhibitor (self); + g_free (owner); +} + +static void +on_proxy_acquired (GObject *object, + GAsyncResult *res, + NMSleepMonitor *self) +{ + GError *error = NULL; + char *owner; + + self->sd_proxy = g_dbus_proxy_new_for_bus_finish (res, &error); + if (!self->sd_proxy) { + nm_log_warn (LOGD_SUSPEND, "Failed to acquire logind proxy: %s", error->message); + g_clear_error (&error); + return; + } + + g_signal_connect (self->sd_proxy, "notify::g-name-owner", G_CALLBACK (name_owner_cb), self); g_signal_connect (self->sd_proxy, "g-signal", G_CALLBACK (signal_cb), self); + + owner = g_dbus_proxy_get_name_owner (self->sd_proxy); + if (owner) + take_inhibitor (self); + g_free (owner); } static void nm_sleep_monitor_init (NMSleepMonitor *self) { self->inhibit_fd = -1; - sleep_setup (self); - take_inhibitor (self); + g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM, + G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START | + G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES, + NULL, + SD_NAME, SD_PATH, SD_INTERFACE, + NULL, + (GAsyncReadyCallback) on_proxy_acquired, self); } static void -- cgit v0.10.2
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor