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();
PIDFile pidFile(settings.GetPIDFileName());
+struct sigaction sa;
+memset(&sa, 0, sizeof(sa));
+sa.sa_handler = SIG_DFL;
+sigaction(SIGHUP, &sa, NULL); // Apparently FreeBSD ignores SIGHUP by default when launched from rc.d at bot time.
+
sigset_t signalSet;
sigfillset(&signalSet);
pthread_sigmask(SIG_BLOCK, &signalSet, NULL);
WriteServLog("+++++++++++++++++++++++++++++++++++++++++++++");
+manager.stop();
+
if (loop.Stop())
WriteServLog("Event loop not stopped.");