]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
fix defaultcgroup detection (better description)
authorRobert Milasan <rmilasan@suse.com>
Thu, 22 Nov 2012 16:47:47 +0000 (17:47 +0100)
committerJan Safranek <jsafrane@redhat.com>
Thu, 29 Nov 2012 11:22:57 +0000 (12:22 +0100)
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 <rmilasan@suse.com>
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
scripts/init.d/cgconfig.in

index 14aa2e3af1f0ee202422f61c252bddce87e2533c..f299d0ff3f73118e8a6ecd0d4e323bd8cc270c68 100644 (file)
@@ -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"