From 9659403b713f947fb4c1518c7417173623ddded8 Mon Sep 17 00:00:00 2001 From: Robert Milasan Date: Thu, 22 Nov 2012 17:47:47 +0100 Subject: [PATCH] fix defaultcgroup detection (better description) b55ce704 (scripts: cgconfig, cleanup) introduced a regression because read is now executed in a subshell so the variables are not visible in the outer context and so defaultcgtoup is never non-empty. Fix the issue by using here text which doesn't involve subshell. Signed-off-by: Robert Milasan Signed-off-by: Jan Safranek --- scripts/init.d/cgconfig.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/init.d/cgconfig.in b/scripts/init.d/cgconfig.in index 14aa2e3a..f299d0ff 100644 --- a/scripts/init.d/cgconfig.in +++ b/scripts/init.d/cgconfig.in @@ -51,8 +51,8 @@ create_default_groups() { defaultcgroup= if [ -f /etc/cgrules.conf ]; then - grep -m1 '^\*[[:space:]]\+' /etc/cgrules.conf | \ - read user ctrl defaultcgroup + read user ctrl defaultcgroup <<< \ + $(grep -m1 '^\*[[:space:]]\+' /etc/cgrules.conf) if [ -n "$defaultcgroup" -a "$defaultcgroup" = "*" ]; then log_warning_msg "/etc/cgrules.conf incorrect" log_warning_msg "Overriding it" -- 2.47.2