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 1CA401381F3 for ; Tue, 16 Jul 2013 18:56:30 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 434FDE0A99; Tue, 16 Jul 2013 18:56:29 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B49D0E0A99 for ; Tue, 16 Jul 2013 18:56:28 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id BF16533E9CA for ; Tue, 16 Jul 2013 18:56:27 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 99626E545F for ; Tue, 16 Jul 2013 18:56:25 +0000 (UTC) From: "William Hubbs" 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" Message-ID: <1372655882.992807de55bd9b0e8cbb569a86bb84b75fe9482e.WilliamH@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: sh/ X-VCS-Repository: proj/openrc X-VCS-Files: sh/rc-cgroup.sh.in X-VCS-Directories: sh/ X-VCS-Committer: WilliamH X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 992807de55bd9b0e8cbb569a86bb84b75fe9482e X-VCS-Branch: master Date: Tue, 16 Jul 2013 18:56:25 +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: 717e7e0b-d4fd-43d1-83a7-a5227abaa40e X-Archives-Hash: b35653850e30a1b5526059b66dba89e9 commit: 992807de55bd9b0e8cbb569a86bb84b75fe9482e Author: Alexander V Vershilov gentoo org> AuthorDate: Sun Jun 30 12:32:30 2013 +0000 Commit: William Hubbs gentoo org> CommitDate: Mon Jul 1 05:18:02 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=992807de Put a service on into a top hierarchy of each cgroup This change will fix unwanted cgroup inheriting from user cgroups, and fixes issues with systemd cgroup tracking by logind. However this fix can lead to incorrect work for some user cgroup controllers - so more advanced solution, that coveres such cases will be created later. Thanks to Fabio Erculiani (lxnay) for testing and general idea. --- sh/rc-cgroup.sh.in | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sh/rc-cgroup.sh.in b/sh/rc-cgroup.sh.in index d96aa16..21f5f50 100644 --- a/sh/rc-cgroup.sh.in +++ b/sh/rc-cgroup.sh.in @@ -72,6 +72,14 @@ cgroup_set_values() cgroup_set_limits() { + # relocate starting process to the top of the cgroup + # it prevents from unwanted inheriting of the user + # cgroups. But may lead to a problems where that inheriting + # is needed. + for d in /sys/fs/cgroup/* ; do + echo $$ > "${d}"/tasks + done + openrc_cgroup=/sys/fs/cgroup/openrc if [ -d "$openrc_cgroup" ]; then cgroup="$openrc_cgroup/$RC_SVCNAME"