Modify ready file path 53/298053/1
authorHwankyu Jhun <h.jhun@samsung.com>
Wed, 30 Aug 2023 23:23:25 +0000 (08:23 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Wed, 30 Aug 2023 23:23:25 +0000 (08:23 +0900)
The ready file path is changed to "/tmp/.<uid>-<loader_name>.ready".

Change-Id: Ia8b59a289b8181be53ef35edb78a89e52c830bb7
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/launchpad-process-pool/loader_context.cc
src/launchpad-process-pool/loader_context.hh

index b47e57d..10b2b87 100644 (file)
@@ -674,11 +674,16 @@ void LoaderContext::OnIOEventReceived(int fd, int condition) {
 }
 
 void LoaderContext::CreateReadyFile() {
-  std::string path = "/run/aul/daemons/" + std::to_string(getuid()) + "/." +
+  if (ready_file_created_)
+    return;
+
+  std::string path = "/tmp/." + std::to_string(getuid()) + "-" +
       GetLoaderName() + ".ready";
   std::filesystem::path file_path(path);
-  if (std::filesystem::exists(file_path))
+  if (std::filesystem::exists(file_path)) {
+    ready_file_created_ = true;
     return;
+  }
 
   std::ofstream file_stream(file_path);
   if (!file_stream.is_open()) {
@@ -692,6 +697,7 @@ void LoaderContext::CreateReadyFile() {
     _E("smack_setlabel() is failed. path: %s, errno: %d", path.c_str(), errno);
 
   _W("File(%s) created successfully", path.c_str());
+  ready_file_created_ = true;
 }
 
 }  // namespace launchpad
index 1bba362..feaf15d 100644 (file)
@@ -154,6 +154,7 @@ class LoaderContext : public std::enable_shared_from_this<LoaderContext>,
   std::vector<std::string> condition_path_exists_;
   IEvent* listener_ = nullptr;
   uint32_t ref_count_ = 0;
+  bool ready_file_created_ = false;
 };
 
 }  // namespace launchpad