unix-socket: reset to ready state on startup - v2 #6091
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rebase of #5928.
Changes: None, just commit message
Tested to confirm that it also fixes new issue:
https://redmine.openinfosecfoundation.org/issues/4434
Note: This initializes all files in the default-log-directory as mentioned in ticket 4434. I think that is best solved as another issue, which is less important than what we are fixing here.
As part of commit ea15282,
some initialization was moved to happen even in unix socket mode,
however, this initialization does setup some loggers that can only have
one instance enabled (anomaly, drop, file-store).
This will cause these loggers to error out on the first pcap, but work
on subsequent runs of the pcap as some deinitialization is done after
each pcap.
This fix just runs the post pcap-file deinitialization routine to
reset some of the initialization done on startup, like is done after
running each pcap in unix socket mode.
Redmine issue:
https://redmine.openinfosecfoundation.org/issues/4225
Additionally this prevents alerts from being logged two times
on the first run of a pcap through the unix socket:
Redmine issue:
https://redmine.openinfosecfoundation.org/issues/4434