commit:     9c90a731e9a00e9af8c86331a45e0348babfde7c
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 25 20:49:36 2018 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Tue Dec 25 21:23:20 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9c90a731

kde-frameworks/kinit: Fix startup delay w/ systemd-240

Package-Manager: Portage-2.3.52, Repoman-2.3.12
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../kinit-5.53.0-systemd-240-soft-rlimit.patch     | 27 +++++++++++++
 kde-frameworks/kinit/kinit-5.53.0-r1.ebuild        | 47 ++++++++++++++++++++++
 2 files changed, 74 insertions(+)

diff --git 
a/kde-frameworks/kinit/files/kinit-5.53.0-systemd-240-soft-rlimit.patch 
b/kde-frameworks/kinit/files/kinit-5.53.0-systemd-240-soft-rlimit.patch
new file mode 100644
index 00000000000..3f8823d5b2d
--- /dev/null
+++ b/kde-frameworks/kinit/files/kinit-5.53.0-systemd-240-soft-rlimit.patch
@@ -0,0 +1,27 @@
+From 26620aef0bd6d01b543e7523dd15dddc1bb871df Mon Sep 17 00:00:00 2001
+From: Oswald Buddenhagen <o...@kde.org>
+Date: Mon, 24 Dec 2018 14:43:23 +0100
+Subject: use soft rlimit for number of open handles
+
+systemd 240 bumped the hard limit from the previous 4k (?) to 1G, which
+makes kdeinit essentially lock up at startup.
+to get around that, use the soft limit, which matches fd_setsize (1k).
+---
+ src/kdeinit/kinit.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/kdeinit/kinit.cpp b/src/kdeinit/kinit.cpp
+index 748bfca..02ab794 100644
+--- a/src/kdeinit/kinit.cpp
++++ b/src/kdeinit/kinit.cpp
+@@ -165,7 +165,7 @@ static void cleanup_fds()
+     int maxfd = FD_SETSIZE;
+     struct rlimit rl;
+     if (getrlimit(RLIMIT_NOFILE, &rl) == 0) {
+-        maxfd = rl.rlim_max;
++        maxfd = rl.rlim_cur;
+     }
+     for (int fd = 3; fd < maxfd; ++fd) {
+ #if KDEINIT_OOM_PROTECT
+-- 
+cgit v1.1

diff --git a/kde-frameworks/kinit/kinit-5.53.0-r1.ebuild 
b/kde-frameworks/kinit/kinit-5.53.0-r1.ebuild
new file mode 100644
index 00000000000..910c3df5286
--- /dev/null
+++ b/kde-frameworks/kinit/kinit-5.53.0-r1.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+KDE_QTHELP="false"
+KDE_TEST="false"
+inherit kde5
+
+DESCRIPTION="Helper library to speed up start of applications on KDE work 
spaces"
+LICENSE="LGPL-2+"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+IUSE="+caps +man X"
+
+RDEPEND="
+       $(add_frameworks_dep kconfig)
+       $(add_frameworks_dep kcoreaddons)
+       $(add_frameworks_dep kcrash)
+       $(add_frameworks_dep ki18n)
+       $(add_frameworks_dep kio)
+       $(add_frameworks_dep kservice)
+       $(add_frameworks_dep kwindowsystem)
+       $(add_qt_dep qtdbus)
+       $(add_qt_dep qtgui)
+       caps? ( sys-libs/libcap )
+       X? (
+               x11-libs/libX11
+               x11-libs/libxcb
+       )
+"
+DEPEND="${RDEPEND}
+       man? ( $(add_frameworks_dep kdoctools) )
+       X? ( x11-base/xorg-proto )
+"
+
+PATCHES=( "${FILESDIR}/${P}-systemd-240-soft-rlimit.patch" )
+
+src_configure() {
+       local mycmakeargs=(
+               $(cmake-utils_use_find_package caps Libcap)
+               $(cmake-utils_use_find_package man KF5DocTools)
+               $(cmake-utils_use_find_package X X11)
+               $(cmake-utils_use_find_package X XCB)
+       )
+
+       kde5_src_configure
+}

Reply via email to