Skip to content

Bug/12187 v5 reliably detect Suricata startup - #19

Closed
KEIAHNY wants to merge 1 commit into
mainfrom
12329-bug-wait-on-suricata-start-v5
Closed

KEIAHNY wants to merge 1 commit into
mainfrom
12329-bug-wait-on-suricata-start-v5

Conversation

@KEIAHNY

@KEIAHNY KEIAHNY commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

PR Type

Bug fix, Enhancement


Description

  • Add Suricata startup detection via pidfile and socket

  • Introduce socket path configuration in YAML and CLI

  • Replace process name check with pidfile-based detection

  • Update stdout handling to null for cleaner execution


Diagram Walkthrough

flowchart TD
  A["Start Suricata"] --> B["Delete old PID file"]
  B --> C["Set PID file path"]
  C --> D["Wait for PID file"]
  D --> E["Verify via socket"]
  E --> F["Confirm Suricata startup"]
Loading

File Walkthrough

Relevant files
Enhancement
argument.rs
Add socket path CLI argument                                                         

src/argument.rs

  • Add path_to_socket CLI argument with -s and --path-to-socket flags
+4/-0     
yaml.rs
Add socket path configuration support                                       

src/yaml.rs

  • Add socket field to Suriconf struct
  • Add find_socket method to parse socket path from YAML
  • Update configuration parsing to handle socket path
+12/-0   
Bug fix
suricata.rs
Implement pidfile and socket-based Suricata startup detection

src/suricata.rs

  • Add PIDFILE constant for Suricata pidfile path
  • Implement delete_pid_file and set_pid_file functions
  • Replace check_process_name_for_suricata_main with get_suricata_pid and
    wait_on_suricata_start
  • Redirect stdout to Stdio::null() for cleaner execution
  • Add socket-based verification for Suricata startup
+78/-18 
Documentation
README.md
Document socket path configuration                                             

README.md

  • Add socket field description in configuration table
+1/-0     
Configuration changes
suriconf.yaml
Add default socket path to configuration                                 

src/suriconf.yaml

  • Add socket field with default path
    /var/run/suricata/suricata-command.socket
+1/-0     

@KEIAHNY KEIAHNY self-assigned this Sep 20, 2026
@github-actions

Copy link
Copy Markdown

Failed to generate code suggestions for PR

@KEIAHNY KEIAHNY closed this Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant