Skip to content

Commit 35c6c21

Browse files
author
emanuele-f
committed
Add check to avoid "list x has 0 rules" on interrupted shutdowns
Fixes #3468
1 parent 0904125 commit 35c6c21

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

scripts/lua/modules/lists_utils.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ local function loadFromListFile(list_name, list, user_custom_categories, stats)
580580

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

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

src/Ntop.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,9 @@ void Ntop::start() {
512512
* After this call, startup.lua has completed. */
513513
pa->startPeriodicActivitiesLoop();
514514

515+
if(globals->isShutdownRequested())
516+
return;
517+
515518
if(get_HTTPserver())
516519
get_HTTPserver()->start_accepting_requests();
517520

0 commit comments

Comments
 (0)