ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
ff6046
From 7b87977aaa9017c7307cc0645c019b9abd4654d6 Mon Sep 17 00:00:00 2001
ff6046
From: Jan Synacek <jsynacek@redhat.com>
ff6046
Date: Thu, 2 May 2019 14:08:39 +0200
ff6046
Subject: [PATCH] Revert "journal: remove journal audit socket"
ff6046
ff6046
This reverts commit 8618ef2fb30b4139c9bec4e45fb499cd8192a87f.
ff6046
ff6046
Resolves: #1699287
ff6046
---
ff6046
 units/meson.build                   |  2 ++
ff6046
 units/systemd-journald-audit.socket | 22 ++++++++++++++++++++++
ff6046
 units/systemd-journald.service.in   |  4 ++--
ff6046
 3 files changed, 26 insertions(+), 2 deletions(-)
ff6046
 create mode 100644 units/systemd-journald-audit.socket
ff6046
ff6046
diff --git a/units/meson.build b/units/meson.build
ff6046
index e54a84ccbf..e4ac6ced64 100644
ff6046
--- a/units/meson.build
ff6046
+++ b/units/meson.build
ff6046
@@ -89,6 +89,8 @@ units = [
ff6046
          'sockets.target.wants/'],
ff6046
         ['systemd-journal-gatewayd.socket',     'ENABLE_REMOTE HAVE_MICROHTTPD'],
ff6046
         ['systemd-journal-remote.socket',       'ENABLE_REMOTE HAVE_MICROHTTPD'],
ff6046
+        ['systemd-journald-audit.socket',       '',
ff6046
+         'sockets.target.wants/'],
ff6046
         ['systemd-journald-dev-log.socket',     '',
ff6046
          'sockets.target.wants/'],
ff6046
         ['systemd-journald.socket',             '',
ff6046
diff --git a/units/systemd-journald-audit.socket b/units/systemd-journald-audit.socket
ff6046
new file mode 100644
ff6046
index 0000000000..cb8b774963
ff6046
--- /dev/null
ff6046
+++ b/units/systemd-journald-audit.socket
ff6046
@@ -0,0 +1,22 @@
ff6046
+#  SPDX-License-Identifier: LGPL-2.1+
ff6046
+#
ff6046
+#  This file is part of systemd.
ff6046
+#
ff6046
+#  systemd is free software; you can redistribute it and/or modify it
ff6046
+#  under the terms of the GNU Lesser General Public License as published by
ff6046
+#  the Free Software Foundation; either version 2.1 of the License, or
ff6046
+#  (at your option) any later version.
ff6046
+
ff6046
+[Unit]
ff6046
+Description=Journal Audit Socket
ff6046
+Documentation=man:systemd-journald.service(8) man:journald.conf(5)
ff6046
+DefaultDependencies=no
ff6046
+Before=sockets.target
ff6046
+ConditionSecurity=audit
ff6046
+ConditionCapability=CAP_AUDIT_READ
ff6046
+
ff6046
+[Socket]
ff6046
+Service=systemd-journald.service
ff6046
+ReceiveBuffer=128M
ff6046
+ListenNetlink=audit 1
ff6046
+PassCredentials=yes
ff6046
diff --git a/units/systemd-journald.service.in b/units/systemd-journald.service.in
ff6046
index 2d5fd0120d..4eab2fa841 100644
ff6046
--- a/units/systemd-journald.service.in
ff6046
+++ b/units/systemd-journald.service.in
ff6046
@@ -12,12 +12,12 @@ Description=Journal Service
ff6046
 Documentation=man:systemd-journald.service(8) man:journald.conf(5)
ff6046
 DefaultDependencies=no
ff6046
 Requires=systemd-journald.socket
ff6046
-After=systemd-journald.socket systemd-journald-dev-log.socket syslog.socket
ff6046
+After=systemd-journald.socket systemd-journald-dev-log.socket systemd-journald-audit.socket syslog.socket
ff6046
 Before=sysinit.target
ff6046
 
ff6046
 [Service]
ff6046
 Type=notify
ff6046
-Sockets=systemd-journald.socket systemd-journald-dev-log.socket
ff6046
+Sockets=systemd-journald.socket systemd-journald-dev-log.socket systemd-journald-audit.socket
ff6046
 ExecStart=@rootlibexecdir@/systemd-journald
ff6046
 Restart=always
ff6046
 RestartSec=0