]> git.ipfire.org Git - suricata-reporter.git/commitdiff
Dynamically replace /var/run
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 21 Aug 2025 14:56:10 +0000 (14:56 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 21 Aug 2025 14:56:10 +0000 (14:56 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
src/reporter.conf.in
src/suricata-reporter.in

index 6449ae4fe82b65bf48321e94d22a831953555ccf..aa635f36bccfba60058629115c915b16f67550a0 100644 (file)
@@ -35,6 +35,7 @@ EXTRA_DIST =
 
 suricataconfdir = $(sysconfdir)/suricata
 suricatalogdir = $(localstatedir)/log/suricata
+suricatarundir = $(runstatedir)/suricata
 
 @INTLTOOL_POLICY_RULE@
 
@@ -88,7 +89,8 @@ substitutions = \
        '|bindir=$(bindir)|' \
        '|sysconfdir=$(sysconfdir)|' \
        '|suricataconfdir=$(suricataconfdir)|' \
-       '|suricatalogdir=$(suricatalogdir)|'
+       '|suricatalogdir=$(suricatalogdir)|' \
+       '|suricatarundir=$(suricatarundir)|'
 
 SED_PROCESS = \
        $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
index 3db6210eb9459b7096bc6c3b3de4ad39a5f10742..4498c6c97393ede2a4a05ce3627dc141b48d8ec4 100644 (file)
@@ -1,6 +1,6 @@
 ;
 ; Example configuration file for the Suricata Reporter
-; 
+;
 ; This application receives events from Suricata to generate reports,
 ; alert emails and store a history of alerts.
 ;
@@ -10,7 +10,7 @@
 ;workers = 4
 
 ; The socket where to receive events from
-;socket = /var/run/suricata/reporter.socket
+;socket = @suricatarundir@/reporter.socket
 
 ; The ownership of the socket
 ;user = suricata
index 585d0d67c45e5bcc527ac86f1638375598e3502c..846a662ba14b693123cd0574200c8c8a9f0883bf 100644 (file)
@@ -95,7 +95,7 @@ class Reporter(object):
        @property
        def socket_path(self):
                return self.config.get("DEFAULT", "socket",
-                       fallback="/var/run/suricata/reporter.socket")
+                       fallback="@suricatarundir@/reporter.socket")
 
        def get_socket_owner(self):
                # Fetch the user/group from the configuration