From 03491caf8351228860fc29d916f9e5c280de27f7 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 30 Jun 2015 11:55:24 +0200 Subject: [PATCH] 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 https://bugzilla.gnome.org/show_bug.cgi?id=751017 (cherry picked from commit 8fdf19863290a82e4000c1549cbc114210f545f1) --- callouts/nm-dispatcher.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/callouts/nm-dispatcher.c b/callouts/nm-dispatcher.c index 77f2153d62..09eb0d3a36 100644 --- a/callouts/nm-dispatcher.c +++ b/callouts/nm-dispatcher.c @@ -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);