chiark / gitweb /
journal: bump RLIMIT_NOFILE when journal files to 16K (if possible)
[elogind.git] / src / systemctl / systemctl.c
index 679541493a74abb5fd59d81b71d19bdbadf2cbbe..86b5ae0b039b4f61e1e80fa2a37430cc2915171d 100644 (file)
@@ -7409,6 +7409,11 @@ int main(int argc, char*argv[]) {
                 goto finish;
         }
 
+        /* 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 (!avoid_bus())
                 r = bus_open_transport_systemd(arg_transport, arg_host, arg_scope != UNIT_FILE_SYSTEM, &bus);