chiark / gitweb /
journald: proceed even if some sockets are unknown
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 26 Nov 2014 20:05:55 +0000 (15:05 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 26 Nov 2014 20:17:07 +0000 (15:17 -0500)
systemd-journald would refuse to start if it received an unknown
socket from systemd. This is annoying, because the failure more for
systemd-journald is unpleasant: systemd will keep restarting journald,
but most likely the same error will occur every time. It is better
to continue. journald will try to open missing sockets on its own,
so things should mostly work.

One question is whether to close the sockets which cannot be parsed or
to keep them open. Either way we might lose some messages. This
failure is most likely for the audit socket (selinux issues), which
can be opened multiple times so this not a problem, so I decided to
keep them open because it makes it easier to debug the issue after the
system is fully started.

src/journal/journald-server.c

index 62ae79a5cee8e3a32c47d6cd9569beb172d8e09a..cd4843c9862ed78973cb6f8fce69260830ad63cd 100644 (file)
@@ -1566,10 +1566,8 @@ int server_init(Server *s) {
 
                         s->audit_fd = fd;
 
-                } else {
-                        log_error("Unknown socket passed.");
-                        return -EINVAL;
-                }
+                } else
+                        log_error("Unknown socket passed as file descriptor %d, ignoring.", fd);
         }
 
         r = server_open_syslog_socket(s);