c28716f
From f0bb63d13a891c909d388ab7ec775d3c30837801 Mon Sep 17 00:00:00 2001
c28716f
From: Lennart Poettering <lennart@poettering.net>
c28716f
Date: Wed, 20 May 2015 14:37:21 +0200
c28716f
Subject: [PATCH] journald: handle more gracefully when bind() fails on audit
c28716f
 sockets
c28716f
c28716f
(cherry picked from commit 417a7fdc418ec76cc4c321c9a07ec15c72b3ac7d)
c28716f
---
c28716f
 src/journal/journald-audit.c | 11 ++++++++---
c28716f
 1 file changed, 8 insertions(+), 3 deletions(-)
c28716f
c28716f
diff --git a/src/journal/journald-audit.c b/src/journal/journald-audit.c
c28716f
index 46eb82fa34..0e739a23af 100644
c28716f
--- a/src/journal/journald-audit.c
c28716f
+++ b/src/journal/journald-audit.c
c28716f
@@ -532,9 +532,14 @@ int server_open_audit(Server *s) {
c28716f
                         return 0;
c28716f
                 }
c28716f
 
c28716f
-                r = bind(s->audit_fd, &sa.sa, sizeof(sa.nl));
c28716f
-                if (r < 0)
c28716f
-                        return log_error_errno(errno, "Failed to join audit multicast group: %m");
c28716f
+                if (bind(s->audit_fd, &sa.sa, sizeof(sa.nl)) < 0) {
c28716f
+                        log_warning_errno(errno,
c28716f
+                                          "Failed to join audit multicast group. "
c28716f
+                                          "The kernel is probably too old or multicast reading is not supported. "
c28716f
+                                          "Ignoring: %m");
c28716f
+                        s->audit_fd = safe_close(s->audit_fd);
c28716f
+                        return 0;
c28716f
+                }
c28716f
         } else
c28716f
                 fd_nonblock(s->audit_fd, 1);
c28716f