summaryrefslogtreecommitdiff
path: root/src/manager.c
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2011-10-17 21:01:40 +0200
committerTollef Fog Heen <tfheen@err.no>2011-10-17 21:04:59 +0200
commit5a8d081c58f7b83172ad5031a8fdac0c33072b2a (patch)
tree50331442e7879881188f68a58b28651c52bc976e /src/manager.c
parente51db373c242b7541794affb2b5e411bcce26d0f (diff)
audit: do not complain if kernel lacks audit
When running on a kernel without audit support, systemd currently writes a mysterious-sounding error to its log: systemd[1]: Failed to connect to audit log: Protocol not supported Better to suppress the audit_open() failure message when (and only when) it is due to running on a kernel without audit support, since in this case the admin probably does not mind systemd not writing to the audit log. This way, more serious errors like ENOMEM and EACCES will stand out more.
Diffstat (limited to 'src/manager.c')
-rw-r--r--src/manager.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/manager.c b/src/manager.c
index 6d20258893..111167a8c2 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -286,7 +286,10 @@ int manager_new(ManagerRunningAs running_as, Manager **_m) {
goto fail;
#ifdef HAVE_AUDIT
- if ((m->audit_fd = audit_open()) < 0)
+ if ((m->audit_fd = audit_open()) < 0 &&
+ /* If the kernel lacks netlink or audit support,
+ * don't worry about it. */
+ errno != EAFNOSUPPORT && errno != EPROTONOSUPPORT)
log_error("Failed to connect to audit log: %m");
#endif