main: move busname claiming later

We should not claim the bus name until the daemon is fully initialized,
especially because we create objects on the dbus that we don't send a
signal for (the manager itself).

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I303fa9a4ab40c93996f9ad64afdc85147c034c86
diff --git a/dump_manager_main.cpp b/dump_manager_main.cpp
index 7ee876a..ce858e4 100644
--- a/dump_manager_main.cpp
+++ b/dump_manager_main.cpp
@@ -65,7 +65,6 @@
 
     // Add sdbusplus ObjectManager for the 'root' path of the DUMP manager.
     sdbusplus::server::manager::manager objManager(bus, DUMP_OBJPATH);
-    bus.request_name(DUMP_BUSNAME);
 
     try
     {
@@ -90,6 +89,9 @@
         phosphor::dump::elog::Watch eWatch(bus, mgr);
         bus.attach_event(eventP.get(), SD_EVENT_PRIORITY_NORMAL);
 
+        // Daemon is all set up so claim the busname now.
+        bus.request_name(DUMP_BUSNAME);
+
         auto rc = sd_event_loop(eventP.get());
         if (rc < 0)
         {