From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 4D62B1384B4 for ; Mon, 16 Nov 2015 23:03:05 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 69562E07F5; Mon, 16 Nov 2015 23:03:02 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id EFD21E07F5 for ; Mon, 16 Nov 2015 23:03:00 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 81BE9340893 for ; Mon, 16 Nov 2015 23:02:58 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id C763FA97 for ; Mon, 16 Nov 2015 23:02:56 +0000 (UTC) From: "Anthony G. Basile" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Anthony G. Basile" Message-ID: <1447715373.a8cc51c8c561a5b98aa079858de05b2b869b6e76.blueness@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/libcgroup/, dev-libs/libcgroup/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-libs/libcgroup/files/cgconfig.confd-r1 dev-libs/libcgroup/files/cgconfig.initd-r1 dev-libs/libcgroup/files/cgred.confd-r1 dev-libs/libcgroup/files/cgred.initd-r1 dev-libs/libcgroup/libcgroup-0.41-r3.ebuild X-VCS-Directories: dev-libs/libcgroup/files/ dev-libs/libcgroup/ X-VCS-Committer: blueness X-VCS-Committer-Name: Anthony G. Basile X-VCS-Revision: a8cc51c8c561a5b98aa079858de05b2b869b6e76 X-VCS-Branch: master Date: Mon, 16 Nov 2015 23:02:56 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: bc140386-b12b-4368-a283-7a48a2083438 X-Archives-Hash: a578dbe9359f7c99a4b5f79aa834f145 commit: a8cc51c8c561a5b98aa079858de05b2b869b6e76 Author: Anthony G. Basile gentoo org> AuthorDate: Mon Nov 16 23:09:14 2015 +0000 Commit: Anthony G. Basile gentoo org> CommitDate: Mon Nov 16 23:09:33 2015 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a8cc51c8 dev-libs/libcgroup: refactor the init scripts. Thanks tokiclover eclipso.email Package-Manager: portage-2.2.20.1 dev-libs/libcgroup/files/cgconfig.confd-r1 | 7 +++ dev-libs/libcgroup/files/cgconfig.initd-r1 | 53 +++++++++++++++++ dev-libs/libcgroup/files/cgred.confd-r1 | 5 ++ dev-libs/libcgroup/files/cgred.initd-r1 | 24 ++++++++ dev-libs/libcgroup/libcgroup-0.41-r3.ebuild | 92 +++++++++++++++++++++++++++++ 5 files changed, 181 insertions(+) diff --git a/dev-libs/libcgroup/files/cgconfig.confd-r1 b/dev-libs/libcgroup/files/cgconfig.confd-r1 new file mode 100644 index 0000000..334958e --- /dev/null +++ b/dev-libs/libcgroup/files/cgconfig.confd-r1 @@ -0,0 +1,7 @@ +# /etc/conf.d/cgconfig: config file for /etc/init.d/cgconfig + +# Configuration file location +CG_CONFIGFILE=/etc/cgroup/cgconfig.conf + +# Enable calssifying pid according to rules if necessary +CG_CLASSIFY=No diff --git a/dev-libs/libcgroup/files/cgconfig.initd-r1 b/dev-libs/libcgroup/files/cgconfig.initd-r1 new file mode 100644 index 0000000..f10d994 --- /dev/null +++ b/dev-libs/libcgroup/files/cgconfig.initd-r1 @@ -0,0 +1,53 @@ +#!/sbin/runscript +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /etc/init.d/cgconfig,v 1.1 2015/02/18 09:53:59 tokiclover Exp $ + +CGCONFIGPARSER="/usr/sbin/cgconfigparser" +CGCLASSIFY="/usr/sbin/cgclassify" +: ${CG_CONFIGFILE:=/etc/cgroup/cgconfig.conf} +description="Control Group Configuration Service" + +start() +{ + ebegin "Setting up CGroups" + ${CGCONFIGPARSER} --load=${CG_CONFIGFILE} >/dev/null 2>&1 + eend "$?" +} + +start_post() +{ + # Classify PID according to the rules if requested + yesno "${CG_CLASSIFY}" || return 0 + ebegin "Classifying PID to CGroups" + local pid + for pid in $(ps --no-headers -eL o tid); do + ${CGCLASSIFY} ${pid} + done + eend "$?" +} + +stop() +{ + cgconfig_umount +} + +cgconfig_umount() +{ + local ctrl eq mnt_pnt mnt_pts + + while read ctrl eq mnt_pnt; do + case "${ctrl}" in + (\#*) continue ;; + (mount*) mnt_pts=true;; + (\}*) mnt_pts= ;; + (*) + [ -n "${mnt_pts}" ] || continue + mnt_pnt="${mnt_pnt%;}" + ebegin "Unmounting ${mnt_pnt}" + umount "${mnt_pnt}" + eend "$?" + ;; + esac + done < "${CG_CONFIGFILE}" +} diff --git a/dev-libs/libcgroup/files/cgred.confd-r1 b/dev-libs/libcgroup/files/cgred.confd-r1 new file mode 100644 index 0000000..e351434 --- /dev/null +++ b/dev-libs/libcgroup/files/cgred.confd-r1 @@ -0,0 +1,5 @@ +# /etc/conf.d/cgred.conf: config file for /etc/init.d/cgred + +# Options to pass to cgrulesengd; +# See the cgrulesengd(8) man page for more info. +CGRED_OPTS="" diff --git a/dev-libs/libcgroup/files/cgred.initd-r1 b/dev-libs/libcgroup/files/cgred.initd-r1 new file mode 100644 index 0000000..85cbb05 --- /dev/null +++ b/dev-libs/libcgroup/files/cgred.initd-r1 @@ -0,0 +1,24 @@ +#!/sbin/runscript +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /etc/init.d/cgred,v 1.1 2015/02/14 09:53:59 tokiclover Exp $ + +command="/usr/sbin/cgrulesengd" +command_args="${CGRED_OPTS}" +command_background="1" +pidfile="/var/run/cgred.pid" +description="CGroups Rules Engine Daemon" +extra_started_commands="reload" + +depend() +{ + need cgconfig + use logger +} + +reload() +{ + ebegin "Reloading CGroup Rules Engine Daemon" + kill -USR2 $(cat "${pidfile}") + eend $? +} diff --git a/dev-libs/libcgroup/libcgroup-0.41-r3.ebuild b/dev-libs/libcgroup/libcgroup-0.41-r3.ebuild new file mode 100644 index 0000000..23304ad --- /dev/null +++ b/dev-libs/libcgroup/libcgroup-0.41-r3.ebuild @@ -0,0 +1,92 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI="5" + +inherit autotools eutils flag-o-matic linux-info pam + +DESCRIPTION="Tools and libraries to configure and manage kernel control groups" +HOMEPAGE="http://libcg.sourceforge.net/" +SRC_URI="mirror://sourceforge/project/libcg/${PN}/v${PV}/${P}.tar.bz2" + +LICENSE="LGPL-2.1" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~ppc64 ~x86" +IUSE="+daemon elibc_musl debug pam static-libs +tools" + +RDEPEND="pam? ( virtual/pam )" + +DEPEND=" + ${RDEPEND} + sys-devel/bison + sys-devel/flex + elibc_musl? ( sys-libs/fts-standalone ) + " +REQUIRED_USE="daemon? ( tools )" + +DOCS=(README_daemon README README_systemd INSTALL) +pkg_setup() { + local CONFIG_CHECK="~CGROUPS" + if use daemon; then + CONFIG_CHECK="${CONFIG_CHECK} ~CONNECTOR ~PROC_EVENTS" + fi + linux-info_pkg_setup +} + +src_prepare() { + epatch "${FILESDIR}"/${P}-replace_DECLS.patch + epatch "${FILESDIR}"/${P}-replace_INLCUDES.patch + epatch "${FILESDIR}"/${P}-reorder-headers.patch + + # Change rules file location + sed -e 's:/etc/cgrules.conf:/etc/cgroup/cgrules.conf:' \ + -i src/libcgroup-internal.h || die "sed failed" + sed -e 's:\(pam_cgroup_la_LDFLAGS.*\):\1\ -avoid-version:' \ + -i src/pam/Makefile.am || die "sed failed" + sed -e 's#/var/run#/run#g' -i configure.in || die "sed failed" + + eautoreconf +} + +src_configure() { + local my_conf + + if use pam; then + my_conf=" --enable-pam-module-dir=$(getpam_mod_dir) " + fi + + use elibc_musl && append-ldflags "-lfts" + econf \ + $(use_enable static-libs static) \ + $(use_enable daemon) \ + $(use_enable debug) \ + $(use_enable pam) \ + $(use_enable tools) \ + ${my_conf} +} + +src_test() { + # Use mount cgroup to build directory + # sandbox restricted to trivial build, + # possible kill Diego tanderbox ;) + true +} + +src_install() { + default + prune_libtool_files --all + + insinto /etc/cgroup + doins samples/*.conf || die + + if use tools; then + newconfd "${FILESDIR}"/cgconfig.confd-r1 cgconfig || die + newinitd "${FILESDIR}"/cgconfig.initd-r1 cgconfig || die + fi + + if use daemon; then + newconfd "${FILESDIR}"/cgred.confd-r1 cgred || die + newinitd "${FILESDIR}"/cgred.initd-r1 cgred || die + fi +}