Establish a separate init script when using the supervisor

The supervisor does not require the full weight of scripts that
init-default.zeek brings with it. The new file, init-supervisor.zeek, contains
only what's required by the supervisor in addition to the other always-loaded
init files.
This commit is contained in:
Christian Kreibich 2021-07-06 17:17:09 -07:00
parent 7bee79b400
commit a3623bfb2d
2 changed files with 13 additions and 1 deletions

View file

@ -0,0 +1,5 @@
##! This script loads functionality needed by the supervisor. Zeek only sources
##! this when the supervisor is active (-j). Like init-default.zeek, this isn't
##! loaded in bare mode.
@load base/frameworks/supervisor

View file

@ -532,7 +532,14 @@ SetupResult setup(int argc, char** argv, Options* zopts)
add_essential_input_file("base/init-frameworks-and-bifs.zeek");
if ( ! options.bare_mode )
{
// The supervisor only needs to load a limited set of
// scripts, since it won't be doing traffic processing.
if ( options.supervisor_mode )
add_input_file("base/init-supervisor.zeek");
else
add_input_file("base/init-default.zeek");
}
add_input_file("builtin-plugins/__preload__.zeek");
add_input_file("builtin-plugins/__load__.zeek");