diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-01-08 03:17:50 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2015-01-16 00:56:59 -0500 |
commit | d366a3148143faf131117e0bfc31851cc1e35aa8 (patch) | |
tree | 466be1f9ed327ca975d1391c8801feea40718a1d /src/systemctl/systemctl.c | |
parent | 06a5b99f71c4b160a67d085b6fc106b07ce0bee3 (diff) | |
download | systemd-d366a3148143faf131117e0bfc31851cc1e35aa8.tar.gz |
journal: bump RLIMIT_NOFILE when journal files to 16K (if possible)
When there are a lot of split out journal files, we might run out of fds
quicker then we want. Hence: bump RLIMIT_NOFILE to 16K if possible.
Do these even for journalctl. On Fedora the soft RLIMIT_NOFILE is at 1K,
the hard at 4K by default for normal user processes, this code hence
bumps this up for users to 4K.
https://bugzilla.redhat.com/show_bug.cgi?id=1179980
(cherry picked from commit de45d726034f33afdb0a185e62fc61bf10a0acd2)
Conflicts:
src/shared/util.h
Diffstat (limited to 'src/systemctl/systemctl.c')
-rw-r--r-- | src/systemctl/systemctl.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index acd980489d..af80f1d942 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -7103,6 +7103,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); |