@ -195,6 +195,7 @@
volatile sig_atomic_t sigint_count = 0 ;
volatile sig_atomic_t sigint_count = 0 ;
volatile sig_atomic_t sighup_count = 0 ;
volatile sig_atomic_t sighup_count = 0 ;
volatile sig_atomic_t sigterm_count = 0 ;
volatile sig_atomic_t sigterm_count = 0 ;
volatile sig_atomic_t sigusr2_count = 0 ;
/*
/*
* Flag to indicate if the engine is at the initialization
* Flag to indicate if the engine is at the initialization
@ -316,6 +317,7 @@ void SignalHandlerSigusr2Idle(int sig)
void SignalHandlerSigusr2 ( int sig )
void SignalHandlerSigusr2 ( int sig )
{
{
#if 0
if ( run_mode = = RUNMODE_UNKNOWN | | run_mode = = RUNMODE_UNITTEST ) {
if ( run_mode = = RUNMODE_UNKNOWN | | run_mode = = RUNMODE_UNITTEST ) {
SCLogInfo ( " Ruleset load signal USR2 triggered for wrong runmode " ) ;
SCLogInfo ( " Ruleset load signal USR2 triggered for wrong runmode " ) ;
return ;
return ;
@ -331,6 +333,8 @@ void SignalHandlerSigusr2(int sig)
DetectEngineSpawnLiveRuleSwapMgmtThread ( ) ;
DetectEngineSpawnLiveRuleSwapMgmtThread ( ) ;
return ;
return ;
# endif
sigusr2_count = 1 ;
}
}
/**
/**
@ -2442,6 +2446,10 @@ int main(int argc, char **argv)
OutputNotifyFileRotation ( ) ;
OutputNotifyFileRotation ( ) ;
sighup_count - - ;
sighup_count - - ;
}
}
if ( sigusr2_count > 0 ) {
DetectEngineReload ( ) ;
sigusr2_count - - ;
}
usleep ( 10 * 1000 ) ;
usleep ( 10 * 1000 ) ;
}
}