disable live rule swap when -s or -S option's used at startup

remotes/origin/HEAD
Anoop Saldanha 14 years ago committed by Victor Julien
parent 31eb5fa2f6
commit 8fb2040eee

@ -715,6 +715,13 @@ TmEcode DetectEngineThreadCtxInit(ThreadVars *tv, void *initdata, void **data) {
return TM_ECODE_OK;
}
/**
* \internal
* \brief This thread is an exact duplicate of DetectEngineThreadCtxInit(),
* except that the counters API 2 calls doesn't let us use the same
* init function. Once we have the new counters API it should let
* us use the same init function.
*/
static TmEcode DetectEngineThreadCtxInitForLiveRuleSwap(ThreadVars *tv, void *initdata, void **data)
{
DetectEngineCtx *de_ctx = (DetectEngineCtx *)initdata;

@ -248,6 +248,13 @@ void SignalHandlerSigusr2EngineShutdown(int sig)
return;
}
void SignalHandlerSigusr2SigFileStartup(int sig)
{
SCLogInfo("Live rule not possible if -s or -S option used at runtime.");
return;
}
static void SignalHandlerSigusr2Idle(int sig)
{
if (run_mode == RUNMODE_UNKNOWN || run_mode == RUNMODE_UNITTEST) {
@ -1455,7 +1462,10 @@ int main(int argc, char **argv)
AppLayerHtpNeedFileInspection();
UtilSignalHandlerSetup(SIGUSR2, SignalHandlerSigusr2Idle);
if (sig_file == NULL)
UtilSignalHandlerSetup(SIGUSR2, SignalHandlerSigusr2Idle);
else
UtilSignalHandlerSetup(SIGUSR2, SignalHandlerSigusr2SigFileStartup);
#ifdef UNITTESTS
@ -1696,7 +1706,8 @@ int main(int argc, char **argv)
/* registering singal handlers we use. We register usr2 here, so that one
* can't call it during the first sig load phase */
UtilSignalHandlerSetup(SIGUSR2, SignalHandlerSigusr2);
if (sig_file == NULL)
UtilSignalHandlerSetup(SIGUSR2, SignalHandlerSigusr2);
#ifdef PROFILING
SCProfilingInitRuleCounters(de_ctx);

Loading…
Cancel
Save