std::set<pid_t> executers;
void StartTimer();
-int StartScriptExecuter(char * procName, int msgKey, int * msgID, SETTINGS_IMPL * settings);
+int StartScriptExecuter(char * procName, int msgKey, int * msgID);
int ForkAndWait(const std::string & confDir);
void KillExecuters();
}
//-----------------------------------------------------------------------------
#if defined(LINUX) || defined(DARWIN)
-int StartScriptExecuter(char * procName, int msgKey, int * msgID, SETTINGS_IMPL * settings)
+int StartScriptExecuter(char * procName, int msgKey, int * msgID)
#else
-int StartScriptExecuter(char *, int msgKey, int * msgID, SETTINGS_IMPL * settings)
+int StartScriptExecuter(char *, int msgKey, int * msgID)
#endif
{
STG_LOGGER & WriteServLog = GetStgLogger();
return -1;
case 0:
- delete settings;
#if defined(LINUX) || defined(DARWIN)
Executer(*msgID, pid, procName);
#else
for (size_t i = 0; i < settings.GetExecutersNum(); i++)
{
- int ret = StartScriptExecuter(argv[0], settings.GetExecMsgKey(), &msgID, &settings);
+ int ret = StartScriptExecuter(argv[0], settings.GetExecMsgKey(), &msgID);
if (ret < 0)
{
STG_LOGGER & WriteServLog = GetStgLogger();
switch (sig)
{
case SIGHUP:
+ {
+ SETTINGS_IMPL newSettings(settings);
+ if (newSettings.ReadSettings())
+ {
+ STG_LOGGER & WriteServLog = GetStgLogger();
+
+ if (newSettings.GetLogFileName() != "")
+ WriteServLog.SetLogFileName(newSettings.GetLogFileName());
+
+ WriteServLog("ReadSettings error. %s", newSettings.GetStrError().c_str());
+ return -1;
+ }
+ settings = newSettings;
traffCnt.Reload();
- manager.reload();
+ manager.reload(settings);
+ }
break;
case SIGTERM:
running = false;