naccyde / rpms / systemd

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