valeriyvdovin / rpms / systemd

Forked from rpms/systemd 4 years ago
Clone

Blame SOURCES/0025-systemctl-bump-NOFILE-only-for-systemctl_main.patch

803fb7
From 4581f8d1cde9b6fac4320e5cdf5234c96bbd60ae Mon Sep 17 00:00:00 2001
803fb7
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
803fb7
Date: Tue, 24 Feb 2015 10:10:04 -0500
803fb7
Subject: [PATCH] systemctl: bump NOFILE only for systemctl_main
803fb7
803fb7
It is not necessary when running as telinit, etc.
803fb7
803fb7
https://bugzilla.redhat.com/show_bug.cgi?id=1184712
803fb7
(cherry picked from commit 95d383ee47db488f182048cfd6846f2e6b859f2b)
803fb7
---
803fb7
 src/systemctl/systemctl.c | 10 +++++-----
803fb7
 1 file changed, 5 insertions(+), 5 deletions(-)
803fb7
803fb7
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
803fb7
index 21cb898b9..6b93ec844 100644
803fb7
--- a/src/systemctl/systemctl.c
803fb7
+++ b/src/systemctl/systemctl.c
803fb7
@@ -7204,6 +7204,11 @@ found:
803fb7
                 }
803fb7
         }
803fb7
 
803fb7
+        /* Increase max number of open files to 16K if we can, we
803fb7
+         * might needs this when browsing journal files, which might
803fb7
+         * be split up into many files. */
803fb7
+        setrlimit_closest(RLIMIT_NOFILE, &RLIMIT_MAKE_CONST(16384));
803fb7
+
803fb7
         return verb->dispatch(bus, argv + optind);
803fb7
 }
803fb7
 
803fb7
@@ -7453,11 +7458,6 @@ int main(int argc, char*argv[]) {
803fb7
                 goto finish;
803fb7
         }
803fb7
 
803fb7
-        /* Increase max number of open files to 16K if we can, we
803fb7
-         * might needs this when browsing journal files, which might
803fb7
-         * be split up into many files. */
803fb7
-        setrlimit_closest(RLIMIT_NOFILE, &RLIMIT_MAKE_CONST(16384));
803fb7
-
803fb7
         if (!avoid_bus())
803fb7
                 r = bus_open_transport_systemd(arg_transport, arg_host, arg_scope != UNIT_FILE_SYSTEM, &bus;;
803fb7