Skip to content

Commit

Permalink
Add check to avoid "list x has 0 rules" on interrupted shutdowns
Browse files Browse the repository at this point in the history
Fixes #3468
  • Loading branch information
emanuele-f committed Mar 27, 2020
1 parent 9e07efe commit e1f2824
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/lua/modules/lists_utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ local function loadFromListFile(list_name, list, user_custom_categories, stats)

traceError(trace_level, TRACE_CONSOLE, string.format("\tRead '%d' rules", num_rules))

if((num_rules == 0) and (not limit_exceeded)) then
if((num_rules == 0) and (not limit_exceeded) and (not ntop.isShutdown())) then
traceError(TRACE_WARNING, TRACE_CONSOLE, string.format("List '%s' has 0 rules. Please report this to https://github.com/ntop/ntopng", list_name))
end

Expand Down
3 changes: 3 additions & 0 deletions src/Ntop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,9 @@ void Ntop::start() {
* After this call, startup.lua has completed. */
pa->startPeriodicActivitiesLoop();

if(globals->isShutdownRequested())
return;

if(get_HTTPserver())
get_HTTPserver()->start_accepting_requests();

Expand Down

0 comments on commit e1f2824

Please sign in to comment.