From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id BDCBC1382C5 for ; Fri, 23 Feb 2018 21:39:01 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C00E3E0845; Fri, 23 Feb 2018 21:39:00 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 9FD17E0845 for ; Fri, 23 Feb 2018 21:39:00 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 292C7335C06 for ; Fri, 23 Feb 2018 21:38:59 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 598581A7 for ; Fri, 23 Feb 2018 21:38:57 +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: <1519420024.38032626a6c2f8e869197999f32ac3634667cc86.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: init.d/ X-VCS-Repository: proj/openrc X-VCS-Files: init.d/cgroups.in X-VCS-Directories: init.d/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 38032626a6c2f8e869197999f32ac3634667cc86 X-VCS-Branch: master Date: Fri, 23 Feb 2018 21:38:57 +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: cf8dd90a-08af-4ebd-b6d5-351519bf39e0 X-Archives-Hash: e5de0cb495e75835174479705da3df4d commit: 38032626a6c2f8e869197999f32ac3634667cc86 Author: William Hubbs gmail com> AuthorDate: Fri Feb 23 21:07:04 2018 +0000 Commit: William Hubbs gentoo org> CommitDate: Fri Feb 23 21:07:04 2018 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=38032626 improve cgroup configuration checks make the base/controller functions return successfully if cgroups v1/v2 are not configured in the kernel init.d/cgroups.in | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/init.d/cgroups.in b/init.d/cgroups.in index fe21904c..8ec91ef6 100644 --- a/init.d/cgroups.in +++ b/init.d/cgroups.in @@ -42,7 +42,8 @@ cgroup1_base() cgroup1_controllers() { - yesno "${rc_controller_cgroups:-YES}" && [ -e /proc/cgroups ] || return 0 + yesno "${rc_controller_cgroups:-YES}" && [ -e /proc/cgroups ] && + grep -qw cgroup /proc/filesystems || return 0 while read -r name _ _ enabled _; do case "${enabled}" in 1) mountinfo -q "/sys/fs/cgroup/${name}" && continue @@ -64,6 +65,7 @@ cgroup1_controllers() cgroup2_base() { + grep -qw cgroup2 /proc/filesystems || return 0 local base base="$(cgroup2_find_path)" mkdir -p "${base}" @@ -74,6 +76,7 @@ cgroup2_base() cgroup2_controllers() { + grep -qw cgroup2 /proc/filesystems || return 0 local active cgroup_path x y cgroup_path="$(cgroup2_find_path)" [ -z "${cgroup_path}" ] && return 0 @@ -91,19 +94,15 @@ cgroup2_controllers() cgroups_hybrid() { - grep -qw cgroup /proc/filesystems || return 0 cgroup1_base - if grep -qw cgroup2 /proc/filesystems; then - cgroup2_base - cgroup2_controllers - fi + cgroup2_base + cgroup2_controllers cgroup1_controllers return 0 } cgroups_legacy() { - grep -qw cgroup /proc/filesystems || return 0 cgroup1_base cgroup1_controllers return 0