Set BMC boot complete checkpoint in unprovision mode

In non provisional mode, pfr service won't run because in pfr manager
code we are calling exit call to stop pfr service.
Code modified when we recieved FinishTimestamp signal from systemd and
then checking provisional status if pfr is unprovisioned then calling
exit call to stop pfr service.

Modified variable name  from  finishedSettingChkPoint to bmcBootCompleteChkPointDone
Modified function name setBMCBootCheckpoint to setBMCBootCompleteChkPoint

Tested:
During unprovision and provision mode BMC checkpoint is setting to 0x09

Change-Id: I91c1fc1d91a44b32ab94924f76b80c0a393ddde1
Signed-off-by: sri anjaneyulu alapati <srix.anjaneyulu.alapati@intel.com>
diff --git a/service/src/mainapp.cpp b/service/src/mainapp.cpp
index 428b0f7..ee21db1 100644
--- a/service/src/mainapp.cpp
+++ b/service/src/mainapp.cpp
@@ -31,7 +31,8 @@
 static int retrCount = 10;
 
 static bool stateTimerRunning = false;
-bool finishedSettingChkPoint = false;
+bool bmcBootCompleteChkPointDone = false;
+bool unProvChkPointStatus = false;
 static constexpr uint8_t bmcBootFinishedChkPoint = 0x09;
 
 std::unique_ptr<boost::asio::steady_timer> stateTimer = nullptr;
@@ -366,10 +367,9 @@
             {
                 phosphor::logging::log<phosphor::logging::level::INFO>(
                     "BMC boot completed. Setting checkpoint 9.");
-                if (!finishedSettingChkPoint)
+                if (!bmcBootCompleteChkPointDone)
                 {
-                    finishedSettingChkPoint = true;
-                    setBMCBootCheckpoint(bmcBootFinishedChkPoint);
+                    setBMCBootCompleteChkPoint(bmcBootFinishedChkPoint);
                 }
                 return;
             }
@@ -422,13 +422,12 @@
         "member='StartupFinished',path='/org/freedesktop/systemd1',"
         "interface='org.freedesktop.systemd1.Manager'",
         [&server, &conn](sdbusplus::message_t& msg) {
-        if (!finishedSettingChkPoint)
+        if (!bmcBootCompleteChkPointDone)
         {
             phosphor::logging::log<phosphor::logging::level::INFO>(
                 "BMC boot completed(StartupFinished). Setting "
                 "checkpoint 9.");
-            finishedSettingChkPoint = true;
-            setBMCBootCheckpoint(bmcBootFinishedChkPoint);
+            setBMCBootCompleteChkPoint(bmcBootFinishedChkPoint);
         }
         });
     checkAndSetCheckpoint(server, conn);
@@ -590,7 +589,8 @@
     return;
 }
 
-void checkPfrInterface(std::shared_ptr<sdbusplus::asio::connection> conn)
+void checkPfrInterface(std::shared_ptr<sdbusplus::asio::connection> conn,
+                       sdbusplus::asio::object_server& server)
 {
     if (!i2cConfigLoaded)
     {
@@ -627,17 +627,15 @@
         }
         else
         {
-            // pfr not supported, stop the service
-            phosphor::logging::log<phosphor::logging::level::INFO>(
-                "PFR not Supported. Hence stop the service");
-            std::exit(EXIT_SUCCESS);
+            unProvChkPointStatus = true;
+            pfr::monitorSignals(server, conn);
         }
     }
 }
 void checkPFRandAddObjects(sdbusplus::asio::object_server& server,
                            std::shared_ptr<sdbusplus::asio::connection>& conn)
 {
-    checkPfrInterface(conn);
+    checkPfrInterface(conn, server);
 
     constexpr size_t timeout = 10; // seconds
     pfrObjTimer->expires_after(std::chrono::seconds(timeout));