]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journal: print a useful error message if we hit the journal file open limit
authorLennart Poettering <lennart@poettering.net>
Tue, 7 Feb 2023 14:03:45 +0000 (15:03 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 7 Feb 2023 14:12:07 +0000 (15:12 +0100)
See: #20921

src/libsystemd/sd-journal/journal-internal.h
src/libsystemd/sd-journal/sd-journal.c
src/shared/journal-util.c

index ed052d1b890de82277e6802dcf509afba658be7c..87ce930d4104a7cdb82ef4a804afef82e1e30f88 100644 (file)
@@ -14,6 +14,8 @@
 #include "list.h"
 #include "set.h"
 
+#define JOURNAL_FILES_MAX 7168u
+
 #define JOURNAL_LOG_RATELIMIT ((const RateLimit) { .interval = 60 * USEC_PER_SEC, .burst = 3 })
 
 typedef struct Match Match;
index 523e23925de46ad4adcbb573f90c2347266eb4f5..c297f06d725f6fa1c1ed0d8b854779e6b22f828e 100644 (file)
@@ -42,8 +42,6 @@
 #include "strv.h"
 #include "syslog-util.h"
 
-#define JOURNAL_FILES_MAX 7168
-
 #define JOURNAL_FILES_RECHECK_USEC (2 * USEC_PER_SEC)
 
 /* The maximum size of variable values we'll expand in catalog entries. We bind this to PATH_MAX for now, as
index bc3d38bb9474b675376b280a53283f3ab368ee99..ea396fcc9ba21f706ec501f52b99b99e288c59c7 100644 (file)
@@ -128,6 +128,10 @@ int journal_access_check_and_warn(sd_journal *j, bool quiet, bool want_other_use
                         log_warning_errno(err, "Journal file %s corrupted, ignoring file.", path);
                         break;
 
+                case ETOOMANYREFS:
+                        log_warning_errno(err, "Too many journal files (limit is at %u) in scope, ignoring file '%s'.", JOURNAL_FILES_MAX, path);
+                        break;
+
                 default:
                         log_warning_errno(err, "An error was encountered while opening journal file or directory %s, ignoring file: %m", path);
                         break;