From 265dbe5dbc14c199299496c6db8fce3f76647015 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Fri, 21 Sep 2018 18:00:10 +0100 Subject: gentoo resync : 21.09.2018 --- sys-fs/quota/Manifest | 2 + .../files/quota-4.04-Listen-on-a-TCP-socket.patch | 77 ++++++++++++++++++++ sys-fs/quota/quota-4.04-r2.ebuild | 82 ++++++++++++++++++++++ 3 files changed, 161 insertions(+) create mode 100644 sys-fs/quota/files/quota-4.04-Listen-on-a-TCP-socket.patch create mode 100644 sys-fs/quota/quota-4.04-r2.ebuild (limited to 'sys-fs/quota') diff --git a/sys-fs/quota/Manifest b/sys-fs/quota/Manifest index 455edbaa7500..48c16a7fa6a8 100644 --- a/sys-fs/quota/Manifest +++ b/sys-fs/quota/Manifest @@ -12,6 +12,7 @@ AUX quota-4.03-no_rpc.patch 2338 BLAKE2B fed1a0cc6864921a26b1d70cb73dc1162a49a16 AUX quota-4.03-noldap_linking.patch 2714 BLAKE2B 8fa02b091086b79719cf4e864f348e4ef3757205fcd975ae610849c51939cf69797f472f8eabbe2d56a9cc596641d6f6adf4b65464ed81166be72192adf9741f SHA512 93617ac00731e9a1e29807c386fb86d5a7c3c646698f7d4faa7837fe363d08a31c96ccb37564b210f8d15e9f331dc6495feac189b2f834c3aff85c0e6e811735 AUX quota-4.03-repqouta_F_option_arg.patch 947 BLAKE2B 22e9811eaaf02816cf61375967c4332f9cb4f4019a051a50166bbc3c96f7737a62ab3d23b5fb5556175b727b9302f6c8f86ed4bace4cc0929dbdc975ac8341f6 SHA512 14bf1dd782861640c4beef0621166006c083266ca0dccfa51d0ee889553b809c6652de82e75710ac961eef3e6fb47d2c528b7111bdefabcbac7967951ec62ac9 AUX quota-4.03-respect_docdir.patch 586 BLAKE2B 83f5d5010ba8a43f07a465b2398ae7db0a2f69af06c95cad9bec368b923c727c03a5d5eda18967a74a06f10b101d874608bc4a351ba47462082dab596441905b SHA512 16feff00e236ac6b652b095fe84fa2fa357c849a85124c92ec32c9a22ae487b2a6f49ea4118f0a665cad27756aeec7e775a42014d2e2408ecefcacb1d60231de +AUX quota-4.04-Listen-on-a-TCP-socket.patch 2432 BLAKE2B cfc2d9d3e8200e0974ee98cf35600185e7331d659117fc4bc0c4f141523475af9c7625dd6b9754199357af212043591089727e7bb9234808aad75c61c345cff6 SHA512 3f6a567a271333d01b4aa81e90fa0fd68a32c7888813c8bd86f5847ad7d8b8f8575370ede313b9e5c922bcb81e1cca3211c18b4ac97a2dcbfca00e282f9fab11 AUX quota-4.04-glibc226.patch 983 BLAKE2B 7d4dd586fb6731d62e8c442d849b33b537e3e93719261ac42889d8de04199286a1ac2a0a0ba32acc174573883288821797d291e33b2b4b57c7fb66e6cab07c90 SHA512 90bcfb9fbb881602cb01000cea691016e6c7c99a5d2fc22b114615fec9ef4752c07253eaeaf80023e6f0768ab95429aac10772f6d12547c43eba4300877f89b9 AUX quota.confd 359 BLAKE2B 37d0cf75f96ca4ccd2d9be1ac3def62a3ac409873cfad33e1fafc515875e587a3ab3f869fd078994bef3174e70c10ce0311a307a808b3469cac73c7f3e8f1883 SHA512 3253b69932332eff2944753f687d780d651dc2b21b524b7055164b91292c13c346cd46443bd58267b239f72fd8918a7e113eec62871573ee94e33df5eb3c82f8 AUX quota.rc7 688 BLAKE2B 18a3317da5360532d6e6d9051f674a7a8e0495fa08aae8511fc7b77d2b16adb36dcdd9e510cb7bd15444b1ae8b606d607cc1ebaa10afb064b052d31ed780afbd SHA512 6a0536285bb340779cf4989060ed5a10c9c4a24a48d334174cd84cd54938d042f7a4047f837f96fc7a3c88a1d20317f662c984bd88c00b32cbf48302ba82a529 @@ -20,4 +21,5 @@ DIST quota-4.03.tar.gz 564352 BLAKE2B b474be79576fd2db7ad5f7c4e93d665fca19004727 DIST quota-4.04.tar.gz 577303 BLAKE2B 8ee1e8f99b70f626ec051e4e9afe53c788b625a29f26afbe075039cf88dde9f6641c39e0ccfdbfcc6981fabe35e8fd15e7203989e9bbbdd1f1772949566531f6 SHA512 adc33863d2a966b4c46983fa3926e6b6ba75e260ed21bdff646584237840e6beb0dcfbfd2f655969aa5675c3c398ac2e483afb933f03f983756ebb3352d0eaad EBUILD quota-4.03.ebuild 1961 BLAKE2B 306162b56dabbb3796c8e5f62c5f1bf675905a1c723a0d9ba34bc7c72b02880f8ab7aa87b9be271b86b19f9396b95514f5f627bec97641599fd9f7e01a35ba85 SHA512 be1868451e07ecdc03dd204357d61a84851801d5426eee81a9c5590f998e54ebf5cb1f7ffee73260d43f82efdbfe439942f633397c70ae4ca83b6b082ef174a8 EBUILD quota-4.04-r1.ebuild 1597 BLAKE2B 1bf5b4269b3fb2a7dfef5407dd2d0be2ad7f1cf730b0b59f6bdc6eddf5a5d9c595013cd4b98c90711da2aa4fb8f04319922d1a37eb4cc7b283728b3ff027f116 SHA512 72dab78bee71c09181e85855d38f79318b952b48aaca910edaf27b018c827b7ab106631662e67616c13ed8de8427d9730f515305d3479e6fbb07712463702784 +EBUILD quota-4.04-r2.ebuild 1654 BLAKE2B d58cc6c0090826d59dbbce6a55c26096bc4d625380b4fac34c67559dd2f3541e09082e2d7836c35707e750d8c4ee6643975458080dbe5c6179acb6d4488ac278 SHA512 817525a07312a932d471a948515068addbc44489459584ca7b5d12ef73301a6f76c06677d388e77ac0d1ad51871bf79ba22afc006055183736053c235aa16027 MISC metadata.xml 482 BLAKE2B 4b2afb537080bc15a4cd9756de6fcbb8df9a19a5a6ea3a7a4e024756be844415d46c07c3321c9dc6bfde8956ec4fb5f3ef87d0dcd090a3f4ed606e724d25fbf4 SHA512 50b2143425f8ab315784fab4d9e569d2f80893c91ba64b4c209947eb79688ed9e8e23955b9f04406d699de6f28e9c10dad78889853d05f84191af65911d7a38e diff --git a/sys-fs/quota/files/quota-4.04-Listen-on-a-TCP-socket.patch b/sys-fs/quota/files/quota-4.04-Listen-on-a-TCP-socket.patch new file mode 100644 index 000000000000..cf1bd4aad32f --- /dev/null +++ b/sys-fs/quota/files/quota-4.04-Listen-on-a-TCP-socket.patch @@ -0,0 +1,77 @@ +From 31ecd29b3b3f51145fd78f63087c10e9fcadf999 Mon Sep 17 00:00:00 2001 +From: Steve Dickson +Date: Tue, 22 May 2018 12:41:59 +0200 +Subject: [PATCH] Listen on a TCP socket +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +rpc.rquotad spins in libtirpc's rendezvous_request() on accepting TCP +connections because the polled TCP socket is not listening: + +poll([{fd=4, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}, {fd=5, + events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}, {fd=6, + events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}, {fd=7, + events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}], 4, -1) = 2 ([{fd=5, + revents=POLLHUP}, {fd=7, revents=POLLHUP}]) +accept(5, 0x7ffe61698700, [128]) = -1 EINVAL (Invalid argument) +accept(7, 0x7ffe61698700, [128]) = -1 EINVAL (Invalid argument) + +The polled descriptors are: + +rpc.rquot 21981 root 4u IPv4 80449159 0t0 UDP *:rquotad +rpc.rquot 21981 root 5u sock 0,9 0t0 80449162 protocol: TCP +rpc.rquot 21981 root 6u IPv6 80449165 0t0 UDP *:rquotad +rpc.rquot 21981 root 7u sock 0,9 0t0 80449168 protocol: TCPv6 + +That results into a high CPU usage just after staring rpc.rquotad +process. + +This patch adds a listen() call to svc_create_sock() +routine which is needed with libtirpc version of svc_tli_create() +as well as a needed IPv6 setsockopt(). + +Signed-off-by: Petr Písař +--- + svc_socket.c | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +diff --git a/svc_socket.c b/svc_socket.c +index 8a44604..d2e3abf 100644 +--- a/svc_socket.c ++++ b/svc_socket.c +@@ -118,6 +118,15 @@ static int svc_create_sock(struct addrinfo *ai) + return -1; + } + ++ if (ai->ai_family == AF_INET6) { ++ if (setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, ++ &optval, sizeof(optval)) < 0) { ++ errstr(_("Cannot set IPv6 socket options: %s\n"), strerror(errno)); ++ close(fd); ++ return -1; ++ } ++ } ++ + if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval)) < 0) { + errstr(_("Cannot set socket options: %s\n"), strerror(errno)); + close(fd); +@@ -129,6 +138,15 @@ static int svc_create_sock(struct addrinfo *ai) + close(fd); + return -1; + } ++ ++ if (ai->ai_protocol == IPPROTO_TCP) { ++ if (listen(fd, SOMAXCONN) < 0) { ++ errstr(_("Cannot listen to address: %s\n"), strerror(errno)); ++ close(fd); ++ return -1; ++ } ++ } ++ + return fd; + } + +-- +2.14.3 + diff --git a/sys-fs/quota/quota-4.04-r2.ebuild b/sys-fs/quota/quota-4.04-r2.ebuild new file mode 100644 index 000000000000..a6080157d8e6 --- /dev/null +++ b/sys-fs/quota/quota-4.04-r2.ebuild @@ -0,0 +1,82 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit autotools + +DESCRIPTION="Linux quota tools" +HOMEPAGE="https://sourceforge.net/projects/linuxquota/" +SRC_URI="mirror://sourceforge/linuxquota/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86" +IUSE="ldap netlink nls rpc tcpd" + +RDEPEND=" + ldap? ( >=net-nds/openldap-2.3.35 ) + netlink? ( + sys-apps/dbus + dev-libs/libnl:3 + ) + rpc? ( + net-nds/rpcbind + elibc_glibc? ( sys-libs/glibc[-rpc(-)] ) + net-libs/libtirpc + net-libs/rpcsvc-proto + ) + tcpd? ( sys-apps/tcp-wrappers ) +" +DEPEND=" + ${RDEPEND} + nls? ( sys-devel/gettext ) +" + +PATCHES=( + "${FILESDIR}/${P}-glibc226.patch" + "${FILESDIR}/${P}-Listen-on-a-TCP-socket.patch" +) + +src_prepare() { + default + eautoreconf +} + +src_configure() { + local myeconfargs=( + --docdir="${EPREFIX%/}/usr/share/doc/${PF}" + $(use_enable nls) + $(use_enable ldap ldapmail) + $(use_enable netlink) + $(use_enable rpc) + $(use_enable rpc rpcsetquota) + ) + econf "${myeconfargs[@]}" +} + +src_install() { + emake DESTDIR="${D}" install + dodoc doc/* README.* Changelog + + insinto /etc + insopts -m0644 + doins warnquota.conf quotatab + + newinitd "${FILESDIR}"/quota.rc7 quota + newconfd "${FILESDIR}"/quota.confd quota + + if use rpc ; then + newinitd "${FILESDIR}"/rpc.rquotad.initd rpc.rquotad + fi + + if use ldap ; then + insinto /etc/openldap/schema + insopts -m0644 + doins "${FILESDIR}"/ldap-scripts/quota.schema + + exeinto /usr/share/quota/ldap-scripts + doexe "${FILESDIR}"/ldap-scripts/*.pl + doexe "${FILESDIR}"/ldap-scripts/edquota_editor + fi +} -- cgit v1.2.3