From 6ebb1b2cc4f299ccb0dd9676a5dad394866f07b7 Mon Sep 17 00:00:00 2001 From: Andreas Herz Date: Mon, 12 Aug 2019 22:19:14 +0200 Subject: [PATCH] rule-reload: enable rule-reload for -s and -S run as well --- src/suricata.c | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/src/suricata.c b/src/suricata.c index 0195254ae6..289072c4f0 100644 --- a/src/suricata.c +++ b/src/suricata.c @@ -2529,8 +2529,7 @@ static void PostRunStartedDetectSetup(const SCInstance *suri) /* registering signal handlers we use. We setup usr2 here, so that one * can't call it during the first sig load phase or while threads are still * starting up. */ - if (DetectEngineEnabled() && suri->sig_file == NULL && - suri->delayed_detect == 0) { + if (DetectEngineEnabled() && suri->delayed_detect == 0) { UtilSignalHandlerSetup(SIGUSR2, SignalHandlerSigusr2); UtilSignalUnblock(SIGUSR2); } @@ -2860,28 +2859,16 @@ static void SuricataMainLoop(SCInstance *suri) } if (sigusr2_count > 0) { - if (suri->sig_file != NULL) { - SCLogWarning(SC_ERR_LIVE_RULE_SWAP, "Live rule reload not " - "possible if -s or -S option used at runtime."); + if (!(DetectEngineReloadIsStart())) { + DetectEngineReloadStart(); + DetectEngineReload(suri); + DetectEngineReloadSetIdle(); sigusr2_count--; - } else { - if (!(DetectEngineReloadIsStart())) { - DetectEngineReloadStart(); - DetectEngineReload(suri); - DetectEngineReloadSetIdle(); - sigusr2_count--; - } } } else if (DetectEngineReloadIsStart()) { - if (suri->sig_file != NULL) { - SCLogWarning(SC_ERR_LIVE_RULE_SWAP, "Live rule reload not " - "possible if -s or -S option used at runtime."); - DetectEngineReloadSetIdle(); - } else { - DetectEngineReload(suri); - DetectEngineReloadSetIdle(); - } + DetectEngineReload(suri); + DetectEngineReloadSetIdle(); } usleep(10* 1000);