chore: cgroup

cgroups are automatically disabled if the phone's kernel doesn't support it
This commit is contained in:
t@marin
2023-03-17 23:43:36 +07:00
parent ac36b2e2cf
commit bbd75c7769

View File

@@ -261,7 +261,10 @@ if [ "${cgroup_memory}" = "true" ]; then
if ${scripts_dir}/box.tool cgroup; then
log info "cgroup limit: ${cgroup_memory_limit}."
else
log error "Failed to enable cgroup for ${bin_name}."
log warn "Failed to enable cgroup for ${bin_name}."
log warn "Cgroups is turned off"
awk -v var="cgroup_memory" '$0 ~ var {gsub("true","false",$0)} {print}' ${settings} > ${data_dir}/tmp && mv ${data_dir}/tmp ${settings}
# sed -i 's/cgroup_memory=true/cgroup_memory=false/g' ${settings}
fi
else
log info "${bin_name} cgroup: disabled."