summaryrefslogtreecommitdiff
path: root/src/journal
diff options
context:
space:
mode:
authorFranck Bui <fbui@suse.com>2022-12-06 20:15:43 +0100
committerLennart Poettering <lennart@poettering.net>2023-01-11 17:18:57 +0100
commit2aba77057e55a1082296c10f61e19d8c5e1eb1f7 (patch)
treec5442e5aaeff446daa3d6635b35312e392590b13 /src/journal
parent8112c91e484ea1a0ba0277f60a5069dd45a3b4b1 (diff)
downloadsystemd-2aba77057e55a1082296c10f61e19d8c5e1eb1f7.tar.gz
journal: give the ability to enable/disable systemd-journald-audit.socket
Before this patch the only way to prevent journald from reading the audit messages was to mask systemd-journald-audit.socket. However this had main drawback that downstream couldn't ship the socket disabled by default (beside the fact that masking units is not supposed to be the usual way to disable them). Fixes #15777
Diffstat (limited to 'src/journal')
-rw-r--r--src/journal/journald-server.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index b59f42c4b8..c1fc5a8da9 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -2504,10 +2504,13 @@ int server_init(Server *s, const char *namespace) {
/* Unless we got *some* sockets and not audit, open audit socket */
if (s->audit_fd >= 0 || no_sockets) {
+ log_info("Collecting audit messages is enabled.");
+
r = server_open_audit(s);
if (r < 0)
return r;
- }
+ } else
+ log_info("Collecting audit messages is disabled.");
r = server_open_varlink(s, varlink_socket, varlink_fd);
if (r < 0)