]> git.stg.codes - stg.git/blobdiff - projects/rscriptd/main.cpp
Allow to user USER_IMPL with USERS_IMPL methods (like SearchNext, Find*
[stg.git] / projects / rscriptd / main.cpp
index e633f9add4089aef82acdbc55f6290a4ea367607..8cf9384dc8319e2ea69e8a9c9000a1ec6a657e25 100644 (file)
 #include <csignal>
 #include <set>
 
-#include "common.h"
-#include "stg_logger.h"
-#include "script_executer.h"
-#include "conffiles.h"
+#include "stg/common.h"
+#include "stg/logger.h"
+#include "stg/scriptexecuter.h"
+#include "stg/conffiles.h"
+#include "stg/version.h"
 #include "listener.h"
 #include "pidfile.h"
-#include "version.h"
 
 using namespace std;
 
@@ -256,8 +256,6 @@ int ForkAndWait(const string & confDir)
 {
 #ifndef NO_DAEMON
 stgChildPid = fork();
-string startFile = confDir + START_FILE;
-unlink(startFile.c_str());
 
 switch (stgChildPid)
     {
@@ -273,23 +271,6 @@ switch (stgChildPid)
         break;
 
     default:    // Parent
-        for (int i = 0; i < 120 * 5; i++)
-            {
-            if (access(startFile.c_str(), F_OK) == 0)
-                {
-                //printf("Fork successfull. Exit.\n");
-                unlink(startFile.c_str());
-                exit(0);
-                }
-
-            if (childExited)
-                {
-                unlink(startFile.c_str());
-                exit(1);
-                }
-            usleep(200000);
-            }
-        unlink(startFile.c_str());
         exit(1);
         break;
     }
@@ -407,11 +388,6 @@ listener->Start();
 WriteServLog("rscriptd started successfully.");
 WriteServLog("+++++++++++++++++++++++++++++++++++++++++++++");
 
-#ifndef NO_DAEMON
-string startFile(confDir + START_FILE);
-creat(startFile.c_str(), S_IRUSR);
-#endif
-
 while (nonstop.GetStatus())
     {
     usleep(100000);
@@ -437,4 +413,3 @@ delete cfg;
 return EXIT_SUCCESS;
 }
 //-----------------------------------------------------------------------------
-