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
This commit is contained in:
Lennart Poettering
2015-01-08 03:20:45 +01:00
parent 2ac23519d0
commit de45d72603
6 changed files with 23 additions and 1 deletions
+2
View File
@@ -1074,3 +1074,5 @@ int same_fd(int a, int b);
int chattr_fd(int fd, bool b, int mask);
int chattr_path(const char *p, bool b, int mask);
#define RLIMIT_MAKE_CONST(lim) ((struct rlimit) { lim, lim })