Load logpath only after findtime is configured

When new log paths are configured, their start offset is immediately determined
by a filter searching for (now - findTime).
But, since findTime is configured *after* the log is loaded and
searched, logs are only searched back by the default 10 minute findTime,
regardless of user configuration of jail settings.

So, findTime must be configured before logpath or else the default findtime
is used, which ignores any findtime time defined by the user.

This fixes new reads on startup for actual log files. The systemd filter
always performed as expected due to being setup after the jail's
findtime config submission.
pull/2173/head
Matt Stancliff 2018-07-05 12:29:41 -04:00 committed by sebres
parent 857d6954c4
commit 00a0e98041
1 changed files with 3 additions and 3 deletions

View File

@ -90,12 +90,12 @@ class JailReader(ConfigReader):
opts1st = [["bool", "enabled", False], opts1st = [["bool", "enabled", False],
["string", "filter", ""]] ["string", "filter", ""]]
opts = [["bool", "enabled", False], opts = [["bool", "enabled", False],
["string", "logpath", None],
["string", "logtimezone", None],
["string", "logencoding", None],
["string", "backend", "auto"], ["string", "backend", "auto"],
["int", "maxretry", None], ["int", "maxretry", None],
["string", "findtime", None], ["string", "findtime", None],
["string", "logpath", None],
["string", "logtimezone", None],
["string", "logencoding", None],
["string", "bantime", None], ["string", "bantime", None],
["string", "usedns", None], # be sure usedns is before all regex(s) in stream ["string", "usedns", None], # be sure usedns is before all regex(s) in stream
["string", "failregex", None], ["string", "failregex", None],