You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bump version to 1.1.0-dev with num_cpus dependency
Update README with Suricata branch and init usage
Diagram Walkthrough
flowchart LR
init["Init command"] -- "generates" --> config["suriconf.yaml from DEFAULT_CONFIG"]
cpurange["CPU range string e.g. 0-6"] -- "expand_cpu_range" --> cpulist["Validated CPU vector"]
cpulist -- "num_cpus check" --> system["Available system CPUs"]
find_max_cpu_usage_vec now validates CPU ids from the YAML config against the machine's current core count (num_cpus::get() via expand_cpu_range/insert_cpu). This makes a previously valid suriconf.yaml fail with a panic ("Unable to parse max cpu usage vector") when the config was authored on a machine with more cores than the one it runs on (e.g., the old default [0,1,2,3,4,5,6] on a 4-core host), or when core counts change due to CPU hotplug/cgroup limits. Config-file values were previously accepted without this check; if this validation is intended only for CLI input, apply it only in parse_cpu_list.
The init command failure is reported via panic!("{e}"), which prints a Rust panic backtrace/stack trace to the user instead of a clean error message. Since init returns io::Result, handling it with an eprintln + non-zero exit code (like the error handling used for open_yaml would ideally be) gives a much better CLI experience. Impact is cosmetic but user-visible for the new init subcommand.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
PR Type
Enhancement, Documentation
Description
Add
initcommand to generate default config fileSupport CPU range expansion in
max_cpu_usage_vec0-6into individual CPUsHashSetBump version to 1.1.0-dev with
num_cpusdependencyUpdate README with Suricata branch and init usage
Diagram Walkthrough
File Walkthrough
5 files
Add CPU range parsing, expansion, and validationAdd Init command and change CPU vec to stringsHandle Init command before main workflowNew module generating default configuration fileRegister config_gen module and embed default config1 files
Refactor io import for delete_pid_file signature1 files
Update version, Suricata spec, and init docs1 files
Bump version and update default configuration values1 files
Bump version to 1.1.0-dev, add num_cpus4 files