chiark / gitweb /
journal: bump RLIMIT_NOFILE when journal files to 16K (if possible)
[elogind.git] / src / journal / journalctl.c
index 62931f14c9bb71d7a886ff6bd66acbdde775b90a..db9576c4933f276b4fafb9303525b61756aac5da 100644 (file)
@@ -1722,6 +1722,11 @@ int main(int argc, char *argv[]) {
         signal(SIGWINCH, columns_lines_cache_reset);
         sigbus_install();
 
+        /* Increase max number of open files to 16K if we can, we
+         * might needs this when browsing journal files, which might
+         * be split up into many files. */
+        setrlimit_closest(RLIMIT_NOFILE, &RLIMIT_MAKE_CONST(16384));
+
         if (arg_action == ACTION_NEW_ID128) {
                 r = generate_new_id128();
                 goto finish;