diff options
author | Thomas Haller <thaller@redhat.com> | 2015-03-13 23:34:47 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2015-03-20 11:43:30 +0100 |
commit | 21562052ec6d5a044003d222bf5b12da4475f9d2 (patch) | |
tree | 6f96429869e93a9525525d2676059a2a64f93403 | |
parent | 7fe0f349ce49500871befc7f00cac59139809fae (diff) | |
download | NetworkManager-21562052ec6d5a044003d222bf5b12da4475f9d2.tar.gz |
main: (order) early start D-Bus service
systemd considers the startup time of NetworkManager until the D-Bus
service is claimed. By doing that earlier, this time is significantly
reduced.
This has the advantage, that services that are ordered to start
after NetworkManager can start earlier. Most notably, 'network.target'
orders itself After=NetworkManager.service and many services are ordered
After=network.target.
$ systemd-analyze blame | grep NetworkManager.service
-rw-r--r-- | src/main.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/main.c b/src/main.c index ef4438c54a..2648a08f41 100644 --- a/src/main.c +++ b/src/main.c @@ -412,6 +412,21 @@ main (int argc, char *argv[]) #endif ); + if (!nm_dbus_manager_get_connection (nm_dbus_manager_get ())) { +#if HAVE_DBUS_GLIB_100 + nm_log_warn (LOGD_CORE, "Failed to connect to D-Bus; only private bus is available"); +#else + nm_log_err (LOGD_CORE, "Failed to connect to D-Bus, exiting..."); + goto done; +#endif + } else { + /* Start our DBus service */ + if (!nm_dbus_manager_start_service (nm_dbus_manager_get ())) { + nm_log_err (LOGD_CORE, "failed to start the dbus service."); + goto done; + } + } + /* Set up platform interaction layer */ nm_linux_platform_setup (); @@ -439,21 +454,6 @@ main (int argc, char *argv[]) goto done; } - if (!nm_dbus_manager_get_connection (nm_dbus_manager_get ())) { -#if HAVE_DBUS_GLIB_100 - nm_log_warn (LOGD_CORE, "Failed to connect to D-Bus; only private bus is available"); -#else - nm_log_err (LOGD_CORE, "Failed to connect to D-Bus, exiting..."); - goto done; -#endif - } else { - /* Start our DBus service */ - if (!nm_dbus_manager_start_service (nm_dbus_manager_get ())) { - nm_log_err (LOGD_CORE, "failed to start the dbus service."); - goto done; - } - } - g_signal_connect (manager, NM_MANAGER_CONFIGURE_QUIT, G_CALLBACK (manager_configure_quit), config); nm_manager_start (manager); |