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 4753A1396D0 for ; Mon, 18 Sep 2017 18:07:41 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AC3F31FC0A3; Mon, 18 Sep 2017 18:07:40 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 8C37D1FC0A3 for ; Mon, 18 Sep 2017 18:07:40 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (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 C346833FE2A for ; Mon, 18 Sep 2017 18:07:39 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 89128746E for ; Mon, 18 Sep 2017 18:07:38 +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: <1505598562.cd5722aca50f0eaddde7ce04ee00da53c313ba7d.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: cd5722aca50f0eaddde7ce04ee00da53c313ba7d X-VCS-Branch: master Date: Mon, 18 Sep 2017 18:07:38 +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: de18a6d1-e8aa-4877-a06e-fd7c0597a1bc X-Archives-Hash: 4158869c752372352cc0508f399d6c84 commit: cd5722aca50f0eaddde7ce04ee00da53c313ba7d Author: William Hubbs gmail com> AuthorDate: Sat Sep 16 21:46:42 2017 +0000 Commit: William Hubbs gentoo org> CommitDate: Sat Sep 16 21:49:22 2017 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=cd5722ac cgroup2_find_path: use legacy mode if cgroup2 is not in the kernel This is related to #164. sh/rc-cgroup.sh.in | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sh/rc-cgroup.sh.in b/sh/rc-cgroup.sh.in index 930eeefc..9e93d841 100644 --- a/sh/rc-cgroup.sh.in +++ b/sh/rc-cgroup.sh.in @@ -146,10 +146,12 @@ cgroup_set_limits() cgroup2_find_path() { - case "${rc_cgroup_mode:-hybrid}" in - hybrid) printf "/sys/fs/cgroup/unified" ;; - unified) printf "/sys/fs/cgroup" ;; + if grep -qw cgroup2 /proc/filesystems; then + case "${rc_cgroup_mode:-hybrid}" in + hybrid) printf "/sys/fs/cgroup/unified" ;; + unified) printf "/sys/fs/cgroup" ;; esac + fi return 0 } @@ -180,7 +182,7 @@ cgroup2_set_limits() { local cgroup_path cgroup_path="$(cgroup2_find_path)" - [ -z "${cgroup_path}" ] && return 0 + [ -d "${cgroup_path}" ] || return 0 rc_cgroup_path="${cgroup_path}/${RC_SVCNAME}" local OIFS="$IFS" IFS="