dispatcher: don't exit with failure in case D-Bus service stops

The initsystem should stop nm-dispatcher before stopping D-Bus
service. However, on some systems that is not implemented, so
nm-dispatcher should not exit with a failure message when the
system bus disappears.
Instead just assume that D-Bus service was stopped during shutdown
and exit gracefully.

Based-on-patch-by: Jacob <jacobgodserv@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=751017
(cherry picked from commit 8fdf198632)
This commit is contained in:
Thomas Haller 2015-06-30 11:55:24 +02:00
parent a961ffc6a8
commit 03491caf83

View file

@ -549,8 +549,13 @@ on_name_lost (GDBusConnection *connection,
gpointer user_data)
{
if (!connection) {
g_warning ("Could not get the system bus. Make sure the message bus daemon is running!");
exit (1);
if (!ever_acquired_name) {
g_warning ("Could not get the system bus. Make sure the message bus daemon is running!");
exit (1);
} else {
g_message ("System bus stopped. Exiting");
exit (0);
}
} else if (!ever_acquired_name) {
g_warning ("Could not acquire the " NM_DISPATCHER_DBUS_SERVICE " service.");
exit (1);