fix for phoshphor-software-manager start issue

Since, the earlier fix adds an empty app, it keeps on restarting because
it exits soon. Add logic for ctx run so app doesn't exit.

Change-Id: I0783af4121cd84044b2800742decef9634f2032f
Signed-off-by: Jagpal Singh Gill <paligill@gmail.com>
diff --git a/software_manager.cpp b/software_manager.cpp
index 5245d71..d362abf 100644
--- a/software_manager.cpp
+++ b/software_manager.cpp
@@ -1,9 +1,26 @@
+#include "config.h"
+
 #include <phosphor-logging/lg2.hpp>
+#include <sdbusplus/async.hpp>
+#include <xyz/openbmc_project/Software/Update/server.hpp>
 
 PHOSPHOR_LOG2_USING;
 
 int main()
 {
     info("Creating Software Manager");
+
+    auto path = std::string(SOFTWARE_OBJPATH) + "/bmc";
+    sdbusplus::async::context ctx;
+    sdbusplus::server::manager_t manager{ctx, path.c_str()};
+    constexpr auto serviceName = "xyz.openbmc_project.Software.Manager";
+
+    ctx.spawn([](sdbusplus::async::context& ctx) -> sdbusplus::async::task<> {
+        ctx.request_name(serviceName);
+        co_return;
+    }(ctx));
+
+    ctx.run();
+
     return 0;
 }