Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 296139 Details for
Bug 395079
sys-apps/openrc: add rc_cgroup option
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
openrc_optional_cgroups.patch
openrc_optional_cgroups.patch (text/plain), 2.42 KB, created by
Piotr Karbowski (RETIRED)
on 2011-12-17 16:52:28 UTC
(
hide
)
Description:
openrc_optional_cgroups.patch
Filename:
MIME Type:
Creator:
Piotr Karbowski (RETIRED)
Created:
2011-12-17 16:52:28 UTC
Size:
2.42 KB
patch
obsolete
>From 0535f0550f37a4213496eb4309e6909e2817f5a3 Mon Sep 17 00:00:00 2001 >From: Piotr Karbowski <piotr.karbowski@gmail.com> >Date: Sat, 17 Dec 2011 17:45:11 +0100 >Subject: [PATCH] Make openrc's cgroup-per-initscript optional and default > set to NO. > >Enforcing openrc-managed cgroups on users isn't good idea nor is suggesting >use of libcgroup. Kernel's SCHED_AUTOGROUP handle cgroups per session just fine. >For example current openrc's implementation will put all ssh users in one group, >unlike sched_autogrup. >--- > etc/rc.conf.Linux | 3 +++ > init.d/sysfs.in | 2 +- > sh/runscript.sh.in | 22 ++++++++++++---------- > 3 files changed, 16 insertions(+), 11 deletions(-) > >diff --git a/etc/rc.conf.Linux b/etc/rc.conf.Linux >index 9b5859a..350205a 100644 >--- a/etc/rc.conf.Linux >+++ b/etc/rc.conf.Linux >@@ -22,3 +22,6 @@ rc_sys="@RC_SYS_DEFAULT@" > # consolefont, numlock, etc ...) > rc_tty_number=12 > >+# Openrc will create a cgroup hierarchy called openrc which will have all >+# services it starts and all subsystems attached to it. Default NO. >+#rc_cgroups="YES" >diff --git a/init.d/sysfs.in b/init.d/sysfs.in >index d57c388..cae2e66 100644 >--- a/init.d/sysfs.in >+++ b/init.d/sysfs.in >@@ -70,7 +70,7 @@ mount_misc() > cgroup /sys/fs/cgroup > eend $? > fi >- if ! mountinfo -q /sys/fs/cgroup/openrc; then >+ if yesno ${rc_cgroups:-NO} && ! mountinfo -q /sys/fs/cgroup/openrc; then > ebegin "creating openrc control group" > mkdir /sys/fs/cgroup/openrc > mount -n -t cgroup -o nodev,noexec,nosuid \ >diff --git a/sh/runscript.sh.in b/sh/runscript.sh.in >index 07f96d8..c619301 100644 >--- a/sh/runscript.sh.in >+++ b/sh/runscript.sh.in >@@ -132,16 +132,18 @@ start() > mark_service_inactive > fi > if [ "$RC_UNAME" = Linux ]; then >- local cgroup=/sys/fs/cgroup/openrc >- local svc_cgroup=${cgroup}/${RC_SVCNAME} >- if mountinfo -q ${cgroup}; then >- mkdir ${svc_cgroup} >- for f in cpuset.cpus cpuset.mems; do >- if [ -f ${cgroup}/${f} ]; then >- cp ${cgroup}/${f} ${svc_cgroup} >- fi >- done >- echo $$ > ${svc_cgroup}/tasks >+ if yesno "${rc_cgroups:-NO}"; then >+ local cgroup=/sys/fs/cgroup/openrc >+ local svc_cgroup=${cgroup}/${RC_SVCNAME} >+ if mountinfo -q ${cgroup}; then >+ mkdir ${svc_cgroup} >+ for f in cpuset.cpus cpuset.mems; do >+ if [ -f ${cgroup}/${f} ]; then >+ cp ${cgroup}/${f} ${svc_cgroup} >+ fi >+ done >+ echo $$ > ${svc_cgroup}/tasks >+ fi > fi > fi > eval start-stop-daemon --start \ >-- >1.7.8 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 395079
:
296139
|
296157
|
296159