From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <gentoo-commits+bounces-838802-garchives=archives.gentoo.org@lists.gentoo.org> Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 8574B13888F for <garchives@archives.gentoo.org>; Tue, 6 Oct 2015 21:34:15 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4D53BE0870; Tue, 6 Oct 2015 21:34:12 +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 EC0A6E0870 for <gentoo-commits@lists.gentoo.org>; Tue, 6 Oct 2015 21:34:11 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 01F09340139 for <gentoo-commits@lists.gentoo.org>; Tue, 6 Oct 2015 21:34:10 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 81917B19 for <gentoo-commits@lists.gentoo.org>; Tue, 6 Oct 2015 21:34:07 +0000 (UTC) From: "William Hubbs" <williamh@gentoo.org> To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" <williamh@gentoo.org> Message-ID: <1444161935.80d3928b0d13f09a9c1e82bd27c9fff943d84d43.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: sh/, etc/ X-VCS-Repository: proj/openrc X-VCS-Files: etc/rc.conf.Linux sh/rc-cgroup.sh.in X-VCS-Directories: etc/ sh/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 80d3928b0d13f09a9c1e82bd27c9fff943d84d43 X-VCS-Branch: master Date: Tue, 6 Oct 2015 21:34:07 +0000 (UTC) Precedence: bulk List-Post: <mailto:gentoo-commits@lists.gentoo.org> List-Help: <mailto:gentoo-commits+help@lists.gentoo.org> List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org> List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org> List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org> X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: d21770ca-c51c-4c99-9ce6-137ed9fca899 X-Archives-Hash: c33720976e018458fd46118583997087 commit: 80d3928b0d13f09a9c1e82bd27c9fff943d84d43 Author: Austin S. Hemmelgarn <ahferroin7 <AT> gmail <DOT> com> AuthorDate: Tue Oct 6 20:02:28 2015 +0000 Commit: William Hubbs <williamh <AT> gentoo <DOT> org> CommitDate: Tue Oct 6 20:05:35 2015 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=80d3928b cgroups: Add the hugetlb, net_cls and pids controllers Note from WilliamH: I slightly rearranged the code and added the settings in rc.conf. X-Gentoo-Bug: 555488 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=555488 etc/rc.conf.Linux | 9 +++++++++ sh/rc-cgroup.sh.in | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/etc/rc.conf.Linux b/etc/rc.conf.Linux index a8ad58b..f04f96e 100644 --- a/etc/rc.conf.Linux +++ b/etc/rc.conf.Linux @@ -62,12 +62,21 @@ rc_tty_number=12 # Set the devices controller settings for this service. #rc_cgroup_devices="" +# Set the hugetlb controller settings for this service. +#rc_cgroup_hugetlb="" + # Set the memory controller settings for this service. #rc_cgroup_memory="" +# Set the net_cls controller settings for this service. +#rc_cgroup_net_cls="" + # Set the net_prio controller settings for this service. #rc_cgroup_net_prio="" +# Set the pids controller settings for this service. +#rc_cgroup_pids="" + # Set this to YES if yu want all of the processes in a service's cgroup # killed when the service is stopped or restarted. # This should not be set globally because it kills all of the service's diff --git a/sh/rc-cgroup.sh.in b/sh/rc-cgroup.sh.in index 3f34d17..b49c711 100644 --- a/sh/rc-cgroup.sh.in +++ b/sh/rc-cgroup.sh.in @@ -109,12 +109,21 @@ cgroup_set_limits() local devices="${rc_cgroup_devices:-$RC_CGROUP_DEVICES}" [ -n "$devices" ] && cgroup_set_values devices "$devices" + local hugetlb="${rc_cgroup_hugetlb:-$RC_CGROUP_HUGETLB}" + [ -n "$hugetlb" ] && cgroup_set_values hugetlb "$hugetlb" + local memory="${rc_cgroup_memory:-$RC_CGROUP_MEMORY}" [ -n "$memory" ] && cgroup_set_values memory "$memory" + local net_cls="${rc_cgroup_net_cls:-$RC_CGROUP_NET_CLS}" + [ -n "$net_cls" ] && cgroup_set_values net_cls "$net_cls" + local net_prio="${rc_cgroup_net_prio:-$RC_CGROUP_NET_PRIO}" [ -n "$net_prio" ] && cgroup_set_values net_prio "$net_prio" + local pids="${rc_cgroup_pids:-$RC_CGROUP_PIDS}" + [ -n "$pids" ] && cgroup_set_values pids "$pids" + return 0 }