GNOME Bugzilla – Bug 741572
[PATCH] Don't autolaunch logind; wait for logind to be ready before taking inhibitor
Last modified: 2015-01-12 15:51:03 UTC
NM doesn't pass G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START to the proxy for logind, resulting in NM auto-launching logind when it starts. Since logind might need the network for login information, this causes logind to be started before the network is up and apparently it doesn't like that. Yeah, logind should just wait for the resources it actually requires to show up or something, but NM also doesn't need to auto-launch it either. Nor does NM care about logind properties, so we can also pass G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES. We can also make the proxy creation non-blocking, and since we need to wait for logind to show up anyway, react to name-owner changes by taking and dropping the inhibitor.
Created attachment 292770 [details] [review] 0001-core-don-t-auto-launch-logind-bgo-741572.patch
Does this seem OK as 1.0 material to everyone?
looks good, and seems fine for 1.0 as long as it gets basic testing
usually we don't indent like this (do we?): »···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, + if (g_dbus_proxy_get_name_owner (self->sd_proxy)) + take_inhibitor (self); this leaks the result of get_name_owner() -- two places. Rest LGTM. Me too: ACK to 1.0 after basic testing.
(In reply to comment #4) > usually we don't indent like this (do we?): > > »···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, You're right, we don't. I'll change it. > + if (g_dbus_proxy_get_name_owner (self->sd_proxy)) > + take_inhibitor (self); > > this leaks the result of get_name_owner() -- two places. Fixed.
Created attachment 292779 [details] [review] 0001-core-don-t-auto-launch-logind-bgo-741572.patch
Tested with restarting logind, and starting NM before logind is started, that logind is not auto-launched, and that NM reconnects to logind when it starts up.
LGTM
master: 5a051ad71671b5808f7b57d5d2cdaaa7b4a66d67 1.0: c140f64b3982a5659ca4554f2b95d69a5733d2e7