cgroup2_find_path: use legacy mode if cgroup2 is not in the kernel
This is related to #164.
This commit is contained in:
parent
dcb4a4d261
commit
cd5722aca5
@ -146,10 +146,12 @@ cgroup_set_limits()
|
|||||||
|
|
||||||
cgroup2_find_path()
|
cgroup2_find_path()
|
||||||
{
|
{
|
||||||
case "${rc_cgroup_mode:-hybrid}" in
|
if grep -qw cgroup2 /proc/filesystems; then
|
||||||
hybrid) printf "/sys/fs/cgroup/unified" ;;
|
case "${rc_cgroup_mode:-hybrid}" in
|
||||||
unified) printf "/sys/fs/cgroup" ;;
|
hybrid) printf "/sys/fs/cgroup/unified" ;;
|
||||||
|
unified) printf "/sys/fs/cgroup" ;;
|
||||||
esac
|
esac
|
||||||
|
fi
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -180,7 +182,7 @@ cgroup2_set_limits()
|
|||||||
{
|
{
|
||||||
local cgroup_path
|
local cgroup_path
|
||||||
cgroup_path="$(cgroup2_find_path)"
|
cgroup_path="$(cgroup2_find_path)"
|
||||||
[ -z "${cgroup_path}" ] && return 0
|
[ -d "${cgroup_path}" ] || return 0
|
||||||
rc_cgroup_path="${cgroup_path}/${RC_SVCNAME}"
|
rc_cgroup_path="${cgroup_path}/${RC_SVCNAME}"
|
||||||
local OIFS="$IFS"
|
local OIFS="$IFS"
|
||||||
IFS="
|
IFS="
|
||||||
|
Loading…
Reference in New Issue
Block a user